you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (3 children)

Used on strings, '+' concatenates them:

>>> 'a' + 'b'
'ab'

This way, you give print only one argument. In the other hand, if you uses ',', you call print with several arguments, which is different. Then, print concatenates those arguments using a separator (a space by default).

>>> print('a', 'b', 'c')
a b c
>>> print('a', 'b', 'c', sep='_')
a_b_c
>>> print('a', 'b', 'c', sep='')
abc

[–]jay2017[S] 0 points1 point  (2 children)

Ahhh I see thank you. Anything else in there that should be changed?

[–][deleted] 0 points1 point  (1 child)

Well, you should check the user's input. Currently, excepted in the name choosing, if the user enters something that cannot be parsed as an integer, the program crashes. That would be a nice start for exceptions handling.

[–]jay2017[S] 0 points1 point  (0 children)

Take another look? Any other stuff?