Sep-20-2018, 01:40 AM
(Sep-20-2018, 12:35 AM)mtndewwarrior Wrote: so with this code i can now bot_corner_to_left_or_right and the program will know that if they selected left or right, and i could now use bot_corner_to_left_or_right in another command and it will know what is the input?
Yes. Whatever text they enter is stored in that variable. Note that user input can be tricky. They might enter 'left' or they might enter 'Left' or they might enter 'left ' (with a space at the end). Since these are not the exact same characters, they are not equal to each other. That's why you will often see:
direction = input('Left or right? ').strip().lower()Input returns a string. Then the strip method of that string returns the string with no spaces at the start or end. Then the lower method of that string returns the string with all the letters lower cased.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures