0% found this document useful (0 votes)
299 views

Unit 3

The document contains a quiz with 5 multiple choice questions testing concepts from Unit 3 on Python programming. It also provides 3 coding exercises asking the user for input and using conditional statements like if/else and comparison operators to return or print specific outputs depending on the input values. The exercises demonstrate how to check if a string is all letters, print the first letter of one input and last letter of another, and use nested if/else statements to print different responses based on a number input being within or outside given ranges.

Uploaded by

api-319267329
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
299 views

Unit 3

The document contains a quiz with 5 multiple choice questions testing concepts from Unit 3 on Python programming. It also provides 3 coding exercises asking the user for input and using conditional statements like if/else and comparison operators to return or print specific outputs depending on the input values. The exercises demonstrate how to check if a string is all letters, print the first letter of one input and last letter of another, and use nested if/else statements to print different responses based on a number input being within or outside given ranges.

Uploaded by

api-319267329
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Unit 3 Quiz

1. An elif statement can come before a if statement.


A. True
B. False
2. What is the answer to (not False or not True)?
A. True
B. False
3. I can run both if statement and else statement
A. True
B. False
4. What is the answer to LifeIs2Good.isalpha()?
A. True
B. False
5. variable1 = Hello World and variable2 = pyglatin
What will variable1[0] + variable2[6] give us?
A. Hn
B. Ht
C. Po
D. Hi

Unit 3 Exercise
Ask the user for an input. If the input is all letters, return True. Else,
return false.
Ask the user for two inputs. Print the first letters of one of the inputs
and print the last letter of the other input (how would we obtain the
index of last letter of a random input? | Hint: len() - 1)
Ask the user for a number as an input. If the input is less than 50, print
I can fight the ninjas. Else, if the input is greater than 50 but less
than 100, print Maybe I can fight the ninjas. Else, if the input is
greater than 100, print Thats too many!

You might also like