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
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:
- START.
- Iterate a loop in the range i = 1 to 7
- Display the value of 35*i.
- 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:
- START.
- Initialise s=0.
- Iterate a loop in the range i = 1 to 10.
- Add the value of i to s.
- Display the value of s.
- 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:
- START.
- Initialise s=0.
- Iterate a loop five times.
- Ask the user to enter the marks (inside loop).
- Add the marks to s.
- Divide s by 5.
- Display the value of s.
- STOP.
See the attachment for output.
Attachments:
Similar questions
Physics,
1 month ago
Math,
1 month ago
CBSE BOARD X,
3 months ago
Math,
9 months ago
Science,
9 months ago