When I was learning programming I use to make a lot of mistakes and now I found out that many of you may have made one or more too.
So here's how to not do it
You may have done somthing like this once:
a = 12 b = 41 c = 234 d = 42
and more. But to avoid this you should have done
a, b, c, d = 12, 41, 234, 42
Now that's more liking!
Yes multiple inputs are a bit mess. But ever heard of the
No? OK now you know it
# don't do this a = input('Enter a number: ') b = input('Enter a number: ') # do this! a, b = input('Enter a number: ').split()
But do mind that when the input is asked then type both the numbers together.
Yes again multiple statements in an if statement are mind crackers!
But no more with variables!
learning = 2 contributed = 5 # write a condition condition = [ learning > 5, contributed > 10 ] if all(condition): # all is like **and** print('A good programmer') # but not me!
Again the same but this time if anyone is right then enter if statement
learning = 2 since = 2020 condition = [ learning > 2, since < 2022 ] if any(condition): print('Good for starters') # That's me!
That's all for this post if you want some more then do tell or if I messed any then do mention