Computer Science, asked by Sawapandeep3852, 7 months ago

Write a python program to add first 10 odd numbers

Answers

Answered by keyboardavro
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 519449
0

Answer:

print("====The First 10 Odd Natural Numbers====")

i = 1

while(i <= 10):

   print(2 * i - 1)

   i = i + 1

Explanation:

Similar questions