+ 1
Is there a problem on sololearn?
I can't do inputs in the playground in python:( https://sololearn.com/compiler-playground/cjl4GTuq78CI/?ref=app
15 Antwoorden
+ 5
Mr. Man ,
after fixing all the mentioned issues, there will be an other bug that should be fixed:
...
print = int(input("enter the correct answer "))
...
> the line shown above will shadow the built-in *print()* function in the current scope, because it assigns an *int value* to the name *print*.
> after this line is executed, print is no longer a function, but a *regular variable*.
> so calling this variable like print('hello') will create a `TypeError` => int object is not callable.
in general:
> since you have not started learning from any python tutorial upto now, i would recommend you to start with the *introduction to python*.
+ 5
Mila ,
it is seen as more helpful when we are not going to post a ready-made code.
it is better to give hints and tips, so that the asker has a chance to find a solution by himself.
+ 2
Yeah you need to fix your indentation of the elif like Mila said. Python is such an annoying princess like that.
+ 2
Thanks for everybody that helped me 😄 :>
+ 1
Yes, there are errors in your code. You need to move elif to the same level as if.
+ 1
Also, in the declaration of the correct_answer variable, you don't need to convert the number 50 to an int. It is already an integer.
correct_answer = 50
+ 1
And your print() is invalid.
You have: print = int(input()), but correct print is print(int(input()).
+ 1
Mr. Man, you can use my code.
https://www.sololearn.com/ru/compiler-playground/cMtz6aZVKqi2/?ref=app
It's working.
+ 1
Besides for the python errors, how do figure the correct answer to be 50 it is actually 75
When you do 50 + 40 ÷ 2 + 5 you must first divide 40 by 2 then add 50 then add 5
If you want to get 50 you need to do (50+40)/2 + 5
+ 1
Don't put print before input
0
You should use if statement
0
Instead of elif