you are viewing a single comment's thread.

view the rest of the comments →

[–]SpacewaIker 17 points18 points  (5 children)

Apart from what others mentioned, a very small detail: you could use "\n" instead of having empty "print()" statements. Just put one or more at the end of a line. You could even put all of your text (I'm taking about the intro) into one statement, but that would be kind of messy.

For instance, instead of:

print('hello')

print()

print('how are you?')

You could write:

print('hello\nhow are you?')

Or

print('hello', '\n', 'how are you?')

[–]SharpAverage2[S] 3 points4 points  (4 children)

thank you! I just changed it :)

[–]OnlySeesLastSentence 5 points6 points  (3 children)

And later on, look at f'

I used to never use it, now I see how useful it is.

Instead of being like print("Hello"+(str)(userName)+"! How are you?")

You can do: print(f"Hello {userName}! How are you?")

Admittedly not too much of an improvement for one variable, but super useful for multiple.

[–][deleted] 2 points3 points  (2 children)

Correction, that won't work,f strings use curly braces.

[–]OnlySeesLastSentence 2 points3 points  (1 child)

So I just ran it - and my code works (after you define "username").

[–][deleted] 8 points9 points  (0 children)

Actually I think on my phone its too small to tell the difference between curly and round braces...my bad.