Computer Science, asked by Ainatripathi, 9 months ago

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.​

Answers

Answered by Anonymous
2

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...✌️

Similar questions