Computer Science, asked by uttampranjal21, 3 months ago

Ques.1a) Write a program to generate a series of marks of 10 students. Give grace marks up to
3 marks of those who are having marks between 30 to 33 marks and print the new list of the
marks.in python​

Answers

Answered by thewakebakecake
1

Answer:

import random

for i in range(1,11):

 

a = random.randrange(1, 100)

print(f"Marks for Student {i} is {a}")

print("")

if a in range(30, 34):

 b = random.randrange(1, 4)

 print(f"Giving grace marks to Student {i}. Grace marks: {b}")

 a += b

 print(f"New marks for Student {i} is {a}")

 print("")

Explanation:

1) To generate random marks and grace marks we get import Random first.

2) We create a For Loop to run it for 10 Students.

3) If we find a student with marks between 30 - 33 we give random grace marks to the student as shown in the if loop. And then we add the marks and show the new marks obtained.

Note: The indents may be wrong please correct it if there wrong. Thank you!

Similar questions