Question: PYTHON 1. Write a selection statement that sets the value of a variable named answer to 1 if a variable named result is equal to
PYTHON
1. Write a selection statement that sets the value of a variable named answer to 1 if a variable named result is equal to 100, and to 2 otherwise.
2. Write a nested selection using if-else that sets the value of a variable gradePoint to 4 if a variable named score is greater than or equal to 90; to 3 if score is between 80 and 89; to 2 if score is between 70 and 79; to 1 if score is between 60 and 69; and to 0 otherwise.
3. Rewrite the selection in question 2 using an elif statement.
Step by Step Solution
There are 3 Steps involved in it
Lets go through the solutions to the three problems stepbystep Problem 1 Objective Write a selection ... View full answer
Get step-by-step solutions from verified subject matter experts
