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")

29th Apr 2022, 11:12 AM
Hani
Hani - avatar
5 Answers
+ 3
In programming spaces are not allowed you need to use a snake case. This replaces the use of space #my_name
29th Apr 2022, 11:23 AM
MATOVU CALEB
MATOVU CALEB - avatar
+ 2
What is "my num" and "her num"? â˜ș
29th Apr 2022, 11:26 AM
Solo
Solo - avatar
+ 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.
29th Apr 2022, 12:24 PM
Emerson Prado
Emerson Prado - avatar
+ 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
29th Apr 2022, 12:29 PM
Emerson Prado
Emerson Prado - avatar
0
Solved. Thanks all!
29th Apr 2022, 12:30 PM
Hani
Hani - avatar