Python Language ONLY!
Python Language ONLY!
Python Language ONLY!
When doing this try to use a level one skill python, like as if you just learned this don't use anything advanced if you can please.
Write a for loop (only one for loop) that computes the total of the following series of numbers: (20/1)+(19/2)+(18/3)+(17/4)+.....+(1/20)
total = 0 # set 0 to total for i in range(1, 21): # this loop will iterate i values from 1 to 20 # 21-i values are 20, 19, 18, ..., 2, 1 # i values are 1, 2, 3, ..., 20 total += (21 - i) / i # this will add 20/1, 19/2, ..., 1/20 to total print(total) # finally print the total
Get Answers For Free
Most questions answered within 1 hours.