0
Can you please check out my code? It just made an error!
eggs=int(input()) my num=int(input()) her num=int(input()) if my num+her num==eggs: print("Candy Time") else: print("Keep Hunting")
5 Answers
+ 3
In programming spaces are not allowed you need to use a snake case. This replaces the use of space
#my_name
+ 2
What is "my num" and "her num"? āŗļø
+ 1
Variable names can contain only letters, numbers and underscores (and can't start with numbers, JFYI). "my num" and "her num" are not valid names. In fact, the interpreter will not even try to understand them as variable names, but two distinct statements.
If you need variable names with multiple words, there are a number of options. In Python, the recommended one is to separate with underscores.
So, use my_num and her_num instead.
+ 1
@MATOVU CALEB * You're right that spaces are not allowed in names. But you don't have to use snake case. It's just one option, like Java case and underscores.
What is recommended is to follow the language style guidelines. Python recommends keeping everything lower case and split words with underscores. Or upper case for constants.
* Could't make citation work from the computer
0
Solved. Thanks all!