P
P
Python Classroom
Ask or search…
K

Problems

Problem 1

Using a for loop, create a table of values for the function
y=x3y=x^3
for the values 0 to 10.
# use the header
print("Number\tCubed")
Create the header: print("Number\tCubed")

Problem 2

Using a for loop, create a table of values for the function
y=x22x+3y=x^2-2x+3
for the values 0 to 10.
# use the header
print("x\ty")

Problem 3

The formula for converting a temperature from Celsius to Fahrenheit is:
F=95C+32F=\frac{9}{5}C + 32
print("Celsius\tFahrenheit")
Use a for loop to display a table of Celsius temperatures from 0 to 10 and their Fahrenheit equivalents. Before the for loop, add the following these lines to create your chart.

Problem 4

Using a for loop, ask the user for 3 integers. Print the average of these numbers.

Problem 5

You play Roblox and start with 500 Robux.
You want to buy 3 items for your estate. In a for loop, ask the user how much each item costs.
Display the total amount of Robux you have left.

Problem 6

Using a for loop, ask the user for 5 integers. Print the third input.

Problem 7

Using a for loop, ask the user for 5 numbers. Print the minimum of these numbers.

Problem 8

Using a for loop, print odd numbers from 1 to 20.