+ 2
Does it have a right to exist?
Please explain what’s wrong or why it can’t be? https://code.sololearn.com/cdj3gAjR6GzV/?ref=app
12 odpowiedzi
+ 4
In python, for input you need to use = instead of := and in the print statement you have used name(input()). As it is taking input single time you need to provide all the inputs at the beginning. Then it won't throw any error.
Attaching the modified code.
https://code.sololearn.com/c511vWEvqVq9/?ref=app
+ 4
This code is fixed
https://code.sololearn.com/cIAeD8b81luH/?ref=app
try it!
+ 2
Ivan Horlenko
Yeah in IDLE it won't throw any error, because there you can be able to run the code line by line execution. But in this editor you have to provide input at the beginning that's why it's throwing an error.
+ 2
Decode
What error you found?
Code is fine. It works well on valid inputs..
Abhi Varshini
For just the info, there
:= is also works fine.. It is called walrus opearator. Used to assign in compound statements function statements.
Using = instead of := in assignment in compound statement is error..
Ivan Horlenko
Original also fine. But there is difference in output statements..
Do you making equalent code for original code? What is wrong you found?
+ 1
I added original solution to code. Please check again
+ 1
When I use IDLE Shell there is no error, it works correct
+ 1
Ivan Horlenko
It is understood now..? Or not? Where if? Just clear your question..
2 codes works fine.
1st ask 2nd input if age>=18 else it don't ask your name..
2 code asks two inputs , you must enter.
Check:
Input samples:
1)
5
2)
22
abc
+ 1
hmm jayakrishna
there was an error before, maybe its gone now...
0
Code is fine.. What is your trouble with code?
0
jayakrishna
theres an error
0
I just trying to understand how it could work at bigger code or at least just logic of these 2 codes
- 1
Ag