If else statement is not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

25th Sep 2020, 2:56 PM
Round Up Kid
Round Up Kid - avatar
15 Answers
+ 1
25th Sep 2020, 3:27 PM
Azhagesanヾ(✿)
Azhagesanヾ(✿) - avatar
+ 1
"Please check the input story of science" I'm facing this problem
25th Sep 2020, 3:28 PM
Round Up Kid
Round Up Kid - avatar
+ 1
Round Up Kid change theory marks to less than 50 and run my code given in answer.
25th Sep 2020, 3:32 PM
Azhagesanヾ(✿)
Azhagesanヾ(✿) - avatar
+ 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
27th Sep 2020, 9:19 AM
SHADOW
SHADOW - avatar
0
The if-else is not a valid word in python. Try else if or elif. This is the right word.
25th Sep 2020, 3:02 PM
:DD
:DD - avatar
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.")
25th Sep 2020, 3:03 PM
Round Up Kid
Round Up Kid - avatar
0
I tried this You also try this then please reply be back
25th Sep 2020, 3:04 PM
Round Up Kid
Round Up Kid - avatar
0
Wait is the coursework defined? (I'm currently learning Python sooo)
25th Sep 2020, 3:05 PM
:DD
:DD - avatar
0
Okay thank you
25th Sep 2020, 3:05 PM
Round Up Kid
Round Up Kid - avatar
0
Thank you
25th Sep 2020, 3:17 PM
Round Up Kid
Round Up Kid - avatar
0
I think my app is not worii I tried pydriod e solo learning nothing work
25th Sep 2020, 3:17 PM
Round Up Kid
Round Up Kid - avatar
0
I'm doing great But I can't reply you there
25th Sep 2020, 3:18 PM
Round Up Kid
Round Up Kid - avatar
0
It says "You can't respond to this number"
25th Sep 2020, 3:19 PM
Round Up Kid
Round Up Kid - avatar
0
Okay thank you so much
25th Sep 2020, 3:33 PM
Round Up Kid
Round Up Kid - avatar
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: [email protected] 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.")
30th Mar 2022, 6:23 AM
Shankar K