Question: for Loop Activity 1. Enter the following Python code that creates a for loop that will display the numbers 1 through 10 for count in
for Loop Activity 1. Enter the following Python code that creates a for loop that will display the numbers 1 through 10 for count in range (1, 10) print (count) a. Execute the loop to be sure that it works. b. Change the 1, 10, to the 10, 8 and then execute the loop. What happens? c. Change the 10, 8 to 8, 10 and execute the loop. What happens? d. Change the 8,10 to 10,12 and execute the loop. What happens? 2. Write a for loop that will display the even numbers from 2 through 12. 3. Write a for loop to perform the following tasks three times: . Get a sales amount from the user. . Calculate the bonus by multiplying the contents of the sales variable by 10% . Store the result in a variable named bonus. . Display the contents of the bonus variable. Create of flowchart and app to calculate the distance a vehicle travels as follows: Distance Speed Time For example, if a train travels 40 miles-per-hour for three hours, the distance traveled is 120 miles. Use a tor loop to display the distance a vehicle has traveled for each hour of a period specified by the user. Get the number of hours traveled and the speed from the user. For example, if a vehicle is g at a speed of 40 mph for a three hour period, it should display the following: Hour: 1 Distance: 40 Hour: 2 Distance: 80 Hour: 3 Distance: 120
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
