PYTHON.....

SOLUTION......

import pandas as pd

# Empty list to store marks
std_marks = []

# Input marks of 10 students
for i in range(1, 11):
    m = int(input(f"Enter marks of student {i}: "))
    std_marks.append(m)

# Create Pandas Series with roll numbers as index
s = pd.Series(data=std_marks, index=range(1201, 1211))

# Apply grace marks
s[s == 32] = s[s == 32] + 1
s[s == 31] = s[s == 31] + 2
s[s == 30] = s[s == 30] + 3

# Print updated marks
print("\nNew list of marks after grace:")
print(s)

OUTPUT….

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.