+ 1
I'm having problem with writing a code using this format, what's might be wrong?
Input ("Enter a number: ") Enter a number: 5 When I run the code it's always an error
2 Réponses
+ 4
You need to store the value read by input() function into a variable, for example,
name = input("Your name: ")
# this is stored as string
age = int(input("Your age: "))
# this is stored as integer (whole number)
salary = float(input("Your salary: "))
# this is stored as floating point (fractional number)
It's also worth noting how SoloLearn takes input for codes, except for web codes. The below code shows how input works in SoloLearn:
https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
+ 4
Can you post the entire code?