Write a python program to add first 10 odd numbers
Answers
Answered by
0
Answer:
Explanation:
# Python Program to Calculate Sum of Odd Numbers from 1 to N
maximum = int(input(" Please Enter the Maximum Value : "))
Oddtotal = 0
for number in range(1, maximum+1):
if(number % 2 != 0):
print("{0}".format(number))
Oddtotal = Oddtotal + number
print("The Sum of Odd Numbers from 1 to {0} = {1}".format(number, Oddtotal))
Answered by
0
Answer:
print("====The First 10 Odd Natural Numbers====")
i = 1
while(i <= 10):
print(2 * i - 1)
i = i + 1
Explanation:
Similar questions
Social Sciences,
3 months ago
English,
3 months ago
CBSE BOARD X,
3 months ago
Math,
7 months ago
Math,
1 year ago