Computer Science, asked by shrishs, 3 months ago

Write a Python Program to :
1) To display the first 7 multiples of 35.
2) Find the sum of the first 10 natural numbers.
3) Accept the marks of 5 subjects from the user as float values and find the average of these marks.
All in Python IDLE. Please answer these questions fast.

Answers

Answered by anindyaadhikari13
6

Answer:

The given programs for the questions is written in Python.

1. To display the first 7 multiples of 35.

print("First seven multiples of 35 are...")

for i in range(1,8):

   print(35*i,end=" ")

Algorithm:

  1. START.
  2. Iterate a loop in the range i = 1 to 7
  3. Display the value of 35*i.
  4. STOP.

2. Find the sum of the first 10 natural numbers.

s=0

for i in range(1,11):

   s+=i

print("Sum of first ten natural numbers is:",s)

Algorithm:

  1. START.
  2. Initialise s=0.
  3. Iterate a loop in the range i = 1 to 10.
  4. Add the value of i to s.
  5. Display the value of s.
  6. STOP.

3. Accept the marks of 5 subjects from the user as float values and find the average of these marks.

s=0

for i in range(5):

   s+=float(input("Enter marks: "))

print("Average Marks:",s/5)

Algorithm:

  1. START.
  2. Initialise s=0.
  3. Iterate a loop five times.
  4. Ask the user to enter the marks (inside loop).
  5. Add the marks to s.
  6. Divide s by 5.
  7. Display the value of s.
  8. STOP.

See the attachment for output.

Attachments:
Similar questions