217k views
2 votes
Помогите пожалуйста исправить код и ответить на вопрос задачи. Что покажет этот код? PYTHON s = ‘Hi! Mister Robert' i = 0 while (i < (len(s))) and (count==0): if s[i] == ‘?': count+=1 i+=1 if count > 0: print("Найдено") else: print ("Готово")

1 Answer

6 votes

Answer:

It checks if "?" exists in the string s. print Найдено if found, otherwise prints Готово

Step-by-step explanation:

s = ‘Hi! Mister Robert'

i = 0

while (i < (len(s))) and (count==0):

if s[i] == ‘?':

count+=1

i+=1

if count > 0:

print("Найдено")

else:

print ("Готово")

User Mcompeau
by
7.4k points