Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Marketing The Ultimate Marketing Tool

Authors: Edward L. Nash

1st Edition

0070460639, 978-0070460638

More Books

Students also viewed these Databases questions