filmov
tv
2022-Spring: Lab 3.8 - Intro to Python

Показать описание
learning how IF statements work
Instructions:
1. Create a new file.
2. Prompt the user to input either a 'y' for yes or 'n' for no. Capture the response in the variable input_yn
3. Use an IF statement to check if the answer is a yes. Assume any input that is not a yes answer is a no.
IF the input was a yes, then output a message stating a positive response
IF the input was NOT a yes, then output a message stating a negative response
4. Prompt the user again to input either a 'y' for yes or 'n' for no. This time. capture the response in the variable input_yn_2
5. Use an "if elif else" statement to perform a similar task as before, except this time we will account for all the following inputs
(if) "yes" input should receive a positive output statement
(elif) "no" input should receive a negative output statement
(else) "any other" input should receive an output statement tell the user that their input was neither a "yes" or a "no"
Instructions:
1. Create a new file.
2. Prompt the user to input either a 'y' for yes or 'n' for no. Capture the response in the variable input_yn
3. Use an IF statement to check if the answer is a yes. Assume any input that is not a yes answer is a no.
IF the input was a yes, then output a message stating a positive response
IF the input was NOT a yes, then output a message stating a negative response
4. Prompt the user again to input either a 'y' for yes or 'n' for no. This time. capture the response in the variable input_yn_2
5. Use an "if elif else" statement to perform a similar task as before, except this time we will account for all the following inputs
(if) "yes" input should receive a positive output statement
(elif) "no" input should receive a negative output statement
(else) "any other" input should receive an output statement tell the user that their input was neither a "yes" or a "no"