13. For your lists error


#1

Hello I wonder if anybody was able to get a green light on this topic.


#2

try removing that comma after num**2


#3

it works now!
tytytytytyty


#4

num = int(num)
print num
"num" must be int


#5

Could you perhaps explain why? When iterating through a string you have to put a comma to print each character in its own line. Is it a general rule that you dont have to do that with lists?


#6

Strange problem/ Why don't just write


#7

well, obviously if you were coding it that would be the way to go, but since the user only creates one part of the for loop that you show here, it's easier to let the user make their own loop instead of having them edit an existing bit of code


#8

It is a general rule that you don't have to do that as long as you are only printing one thing ("print 2, 3, 4, 5" is still useful).
Them specific rule is not in regards to lists, but strings.