for eg: mango=fruit if mango was the input we get from the user we had to print fruit how can i do it
7/7/2018 8:07:01 PM
Parthiban03 0005 Answers
New AnswerSo for this you might want to create a dictionary. You could do dict = {“mango”:”fruit”, “crow”:”bird”, “tiger”:”animal”} n=input() print(dict[n])
You can check out my example code i made a while back https://code.sololearn.com/c17A83Q6v7il/?ref=app
in single content ok what if in this case mango=fruit carrot=vegetable Crow=bird tiger=animal n=input() here we must print the right side when left side given as input by someone how can we do it for eg: if Crow was the input the output must be bird
Learn Playing. Play Learning
SoloLearn Inc.
4 Embarcadero Center, Suite 1455Send us a message