+ 1

How can I use input to call a specific letter or word in order to output my codes. For example input("type A to output my code")

Help! Help!! Help!!!

24th Sep 2020, 11:30 PM
Muhammad Abdulmalik
Muhammad Abdulmalik - avatar
6 Réponses
+ 2
c = input() if c == "a": print("hi")
25th Sep 2020, 12:02 AM
Grayson
Grayson - avatar
+ 1
What am meant with my above question is that, for example; Boolean_Value = input("Type letter T to print True with the following statements: ") print(10 + 10 == 20) print(10 - 10 == 0) print(10 * 10 == 100) What should I do to type only letter T to print the statements meanwhile if you type other thing else it will not print the statements........ I hope you guys understand it now..... thanks.
25th Sep 2020, 8:48 AM
Muhammad Abdulmalik
Muhammad Abdulmalik - avatar
0
Didn't get that idea honestly, but maybe you can look forward to use a dictionary, where a dictionary item is a letter or word, and the value be what you want to output. Try to sketch a code for it first, the community will assist as needed.
24th Sep 2020, 11:59 PM
Ipang
0
So it sounds like... If input is equal to string: do something Do you have any code you can share, it will help
25th Sep 2020, 12:00 AM
Steven M
Steven M - avatar
0
hope this helped
25th Sep 2020, 12:02 AM
Grayson
Grayson - avatar
0
you could add if Boolean_value = T: print(“whaterver you want to be printed”)
25th Sep 2020, 10:51 AM
Grayson
Grayson - avatar