Я проходил некоторые практики для Python на PySchools.com и застрял здесь. Я уверен, что это простая задача. Кто-нибудь?
Вы можете использовать функцию len (x), чтобы узнать количество символов в строке.
Примеры
>>> greetings = "Hello World"
>>> len(greetings) # get the length of string
11
>>> greetings[0] # get the 1st character
'H'
Вопрос здесь ниже:
greeting = "Hello Google!"
# number of characters stored in the variable greeting
number_of_char = len(greeting)
# repeat the greetings based on the number of character in 'greeting'
greetings =
http://www.pyschools.com/quiz/view_question/s1-q7