+ 1
Why not correct?
5 odpowiedzi
+ 2
https://code.sololearn.com/cfkbWw5F0M5M/?ref=app
+ 3
In addition to what TurtleShell stated, your if else logic is backwards for the use of (ad >= 50). more should be in the if statement and less in the else.
You could also do a print statement like:
print(ad, 'more than 50')
without the explicit need to convert ad to a string first.
+ 2
Optional
- The parameters a and d are useless since you gonna ask for input and then put that input into the variables so remove them
- Have a better name for ad variable like sum or total
To get the code working properly
- Call your function
- Put int(input()) instead of just input() so Python will turn the input from string to int
- You have to turn the ad variable into a string or use string formating in the print() function like... print(str(ad) + " is less than 50")
+ 1
Sorry, but I did not understand how to do it. Could you write How to write this code correctly?
+ 1
thanks, guys :D