Skip to content

Conversation

@juli-nagy
Copy link

No description provided.

for i in newlist:
if isinstance(i,float):
count=count+1
print(count) No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok is everything
newlist=["k", 6.8, 99, 345, True, "66"] def count(newlist): count=0 for i in newlist: if isinstance(i,float): count=count+1 print(count)

for i in text:
if i.isdigit():
count=count+1
print(count) No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok is everything
def task2(text): count = 0 for i in text: if i.isdigit(): count = count + 1 print(count)

newlist=list(text.split(" "))
rang=len(newlist)
for i in range(rang-2, -1, -2):
print(newlist[i]) No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok is everything
def task2(): text = "ghkdlh5673bjhdvfl" count = 0 for i in text: if i.isdigit(): count = count + 1 print(count)

print(new_text)
for elem in new_text:
for i in range(len(new_text)-1):#range 0-8
if i%2==1:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Краще використати
if elem in new_text[1::2]:

amount=re.findall(lis[i], text)
amount_list.append(len(amount))
print(amount_list, lis)
for i in range(len(lis)-1):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Використовуйте
range(len(lis))

if i%2==1:
lis.append(elem)
print(lis)
for i in range(len(lis)-1):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Використовуйте
range(len(lis))

print(lis)
for i in range(len(lis)-1):
amount=re.findall(lis[i], text)
amount_list.append(len(amount))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Всуньте amount_list.append(len(amount)) в for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants