0

Why is function i not defined and unexpected end of input and help with more commands

https://code.sololearn.com/W7uxXY7xpGqD/?ref=app

18th Jun 2022, 12:41 AM
Form8toryy
Form8toryy - avatar
3 Réponses
+ 3
Use something else for variable name, don't use 'prompt' as variable name, 'prompt' itself is a method name for getting text input, as you already know.
18th Jun 2022, 2:14 AM
Ipang
+ 2
There is a syntax error in the function, so it fails to get defined. Use indentation, and you will see it clearly. It's all about balancing curly brackets.
18th Jun 2022, 12:58 AM
Emerson Prado
Emerson Prado - avatar
+ 2
You can not use reserved words as variables. prompt is reserved.
18th Jun 2022, 2:20 AM
Chris Coder
Chris Coder - avatar