How to print the content within an input? | SoloLearn: Learn to code for FREE!

+1

How to print the content within an input?

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 000

5 Answers

New Answer

+3

So for this you might want to create a dictionary. You could do dict = {“mango”:”fruit”, “crow”:”bird”, “tiger”:”animal”} n=input() print(dict[n])

+3

You can check out my example code i made a while back https://code.sololearn.com/c17A83Q6v7il/?ref=app

+1

super bro

0

print(mango)

0

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