+ 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!!!
6 Answers
+ 2
c = input()
if c == "a":
print("hi")
+ 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.
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.
0
So it sounds like...
If input is equal to string: do something
Do you have any code you can share, it will help
0
hope this helped
0
you could add if Boolean_value = T:
print(âwhaterver you want to be printedâ)