+2

if statement

https://code.sololearn.com/cf86TKhxlfTJ/#py Can anyone help me with what mistake I made ?? and help me sort it out

4/1/2020 11:05:01 AM

Mani

7 Answers

New Answer

+7

Mani You code should be like this print("Welome To Vidya Vikas Institue of Engineering aAnd Tehnology") branch= input("Enter Your Branch:") if(branch=="ECE"): print("YOu belong to 'A' Section") Now compare,you will find the difference/mistake

+6

Because there is no use of these statements that's why I commented these statements. even you can remove these statement

+5

Mani check out this edited code https://code.sololearn.com/c59p7y0QKTwb/?ref=app

0

https://code.sololearn.com/chvLQrssON4m/?ref=app Bro, in this one Correct me And show me what should I add so that as I enter a branch name i get my section (A or B or C)

0

Why did you use # for A,B,C,D,E

0

Please use " " quotes in string .. Like if branch=="ECE":

0

change the print statement to print(branch) instead of print(“branch”). the intention is to print the branch entered by user and not the name branch itself. and also change your else statement too. ex: if user enters invalid branch name as “egs” invalid then if your intention is to print this “Invalid branch entered, egs” you should change your else statement to else: print(“invalid branch entered”, branch)