0
If else statement is not working
How to run if else statement please answer I have profectionall code then also it don't work Maybe it's my personal app problem Please answer
15 Réponses
+ 1
I just cleared errors try this
https://code.sololearn.com/cuGz5Kt24aTK/?ref=app
+ 1
"Please check the input story of science"
I'm facing this problem
+ 1
Round Up Kid change theory marks to less than 50 and run my code given in answer.
+ 1
U can use it like this
If 10 > 5
Print ("True")
Else:
Print ("False")
Check this out for elif
https://code.sololearn.com/cRXbqIb8K0xX/?ref=app
😊😊 Happy learning
0
The if-else is not a valid word in python. Try else if or elif. This is the right word.
0
score_theory = 53
score_practical = 35
if(coursework == "Science" or coursework == "science"):
if(score_theory > 50):
print("Please check the input score for 'Science: Theory'.")
elif(score_practical > 50):
print("Please check the input score for 'Science: Practical'.")
else:
print("Score validated for Science. Your total is: ",score_theory + score_practical)
elif(coursework == "English" or coursework == "english"):
if(score_theory > 60):
print("Please check the input score for 'English: Theory'.")
elif(score_practical > 40):
print("Please check the input score for 'English: Practical'.")
else:
print("Score validated for English. Your total is: ",score_theory + score_practical)
else: print("Coursework not recognised. Please enter score for either Science or English.")
0
I tried this
You also try this then please reply be back
0
Wait is the coursework defined? (I'm currently learning Python sooo)
0
Okay thank you
0
Thank you
0
I think my app is not worii
I tried pydriod e solo learning nothing work
0
I'm doing great
But I can't reply you there
0
It says "You can't respond to this number"
0
Okay thank you so much
0
you have to try python 3 version and you must use tab key instead of space bar for indentation. I already executed in my computer. Output also executed. if you want any queries contact my email id: ravishankar28821@gmail.com
This code is executed perfectly
coursework = "english"
score_theory = 53
score_practical = 35
if (coursework == "Science" or coursework == "science"):
if (score_theory > 50):
print ("please check the input score for 'science: theory'.")
elif (score_practical > 50):
print ("please check the input score for 'science: practical'.")
else:
print ("score validated for science. your total is:", score_theory + score_practical)
elif (coursework == "English" or coursework == "english"):
if (score_theory > 60):
print ("please check the input score for 'English: theory'.")
elif (score_practical > 40):
print ("please check all the inputs score for 'English: practical'.")
else:
print ("score validated for English. your total is:", score_theory + score_practical)
else:
print ("coursework not recognized. please enter score for either Science or English.")