InterviewSolution
Saved Bookmarks
| 1. |
write a program to enter first chracter of subject and Accord ing to subject print its corresponding subject for example if he enters p ie. we have to print physics. |
|
Answer» Answer: hi...it's a python code... I am just using six subjects..if you want yoyh can add other subjects too..in the SIMILAR way... Explanation: char=str(INPUT("enter the first character of the subject")) if char.upper()=="P": print("physics") elif char.upper()=="C": print(" CHEMISTRY") elif char.upper()=="CS": print("computer science") elif char.upper()=="M": print("maths") elif char.upper()=="E": print("English") elif char.upper()=="B": print("biology") else: print (" subject not FOUND,try entering some other character") hope it helps you...✌️ |
|