26.4k views
1 vote
using a for loop, write a program that prints out the decimal equivalents of 1/2, 1/3, 1/4,..., 1/10.

1 Answer

5 votes
In python:

##Specifies the range that the variable 'number' should change within
for number in range(2,10):
##Prints the decimal equivalent of each fraction
print(1 / number)
User Scott Fines
by
7.6k points