0

Some help, I have been trying to output this but it's like they are sayg it has a prob in line 3 or if u can see any error in it

name=input("What is your name? ") print(f'\n Your name is: {name}') course=input("What is your course? ") print(f'\n Your course is: {course}') age=int(input("What is your age? ")) print(f'\n Your age is: {age}') It's in Python

24th Jan 2025, 3:19 PM
Rehema Namakula
Rehema Namakula - avatar
7 Answers
+ 4
Are you running this from the SoloLearn playground, and got an EOL message? If yes, you have to provide all inputs in the box after hitting the "run" button. Each input on a separate line, as the box hinted. The playground is not interactive, aka, it won't wait for your input while the program is running.
24th Jan 2025, 3:47 PM
Wong Hei Ming
Wong Hei Ming - avatar
+ 4
The code has nothing wrong with it But the error like EOL error, then it's because you will need to write all the input at once like Wong Hei Ming have said, for example: parrot python course 21 This is because Sololearn input is not interactive, which will cause the error if you done provide enough inputs
24th Jan 2025, 7:23 PM
☕︎︎AstroParrot✦
☕︎︎AstroParrot✦ - avatar
+ 4
Rehema Namakula write all the inputs at once, imagine all the inputs in your code are sorted, like this: What is your name?: What is your course?: What is your age?: So you will need to write the inputs just like how the questions were sorted, seperate each input by line
25th Jan 2025, 1:12 PM
☕︎︎AstroParrot✦
☕︎︎AstroParrot✦ - avatar
+ 2
Rehema Namakula your given code is working as intended. The thing your getting error is because in the age you have given integer or number which is int. So you need to give number only otherwise it will give error.
24th Jan 2025, 3:27 PM
Aysha
0
What do u mean by writing all the inputs
25th Jan 2025, 12:16 PM
Rehema Namakula
Rehema Namakula - avatar
0
Rehema Namakula in your given code your asking for the input from the user using input functions and when the input is written it gives intended output otherwise you would have given direct variables which doesn't require any inputs from the users.
25th Jan 2025, 12:19 PM
Aysha
0
Thanx for the views
25th Jan 2025, 12:25 PM
Rehema Namakula
Rehema Namakula - avatar