0

‘Code Coach’ problems

Hi I’m trying to solve problems from the code coach section, but the solver always tells me that the input is not iterable. Any ideas what I’m doing wrong?

9th Jan 2021, 9:51 PM
Vladimir Vassev
Vladimir Vassev - avatar
5 Antworten
+ 2
Are you trying to do:- for letter in input(): ........................... ...........................
9th Jan 2021, 10:35 PM
rodwynnejones
rodwynnejones - avatar
+ 1
Will this help? import string input = input() output= "" for letter in input: if letter in string.ascii_lowercase or letter in string.ascii_uppercase or letter in " ": output = output + letter output = output[::-1] print(output)
9th Jan 2021, 10:39 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
yes. thank you both!
9th Jan 2021, 10:41 PM
Vladimir Vassev
Vladimir Vassev - avatar
0
Are you trying to iterate an integer? Can you post an example. Please include your language in your tags so people with correct skillset may assist you
9th Jan 2021, 10:03 PM
Rik Wittkopp
Rik Wittkopp - avatar
0
sorry python example: import string output= "" for letter in input: if letter in string.ascii_lowercase or letter in string.ascii_uppercase or letter in " ": output = output + letter output = output[::-1] print(output)
9th Jan 2021, 10:20 PM
Vladimir Vassev
Vladimir Vassev - avatar