Suppose there is class of 30 students who have attendance between 40- 100%. The university has decided to give the bonus attendance between for those students who have the attendance between 70-74% to make it 75%. Identify the students those have attendance after adding the bonus attendance. Suppose students have its Roll_no & attendance. Add the bonus attendance to the obtained final attendance of student through array. Use functions to solve this tasks.
Input Format -The input should contain a roll_no, and attendance of 25 students.
Output Format-For each test case, display the roll_no and increased attendance of those students only who lies between the obtained attendance of 70-74%.
roll_num=[]
attendance=[]
n=4
for i in range(n):
roll1=input("Enter roll number for student: ")
roll_num.append(roll1)
att1=int(input("Enter attendance for student: "))
attendance.append(att1)
for i in range(n):
if attendance[i]>=70 and attendance<=74:
attendance[i]=70
for i in range(n):
print(roll_num[i]," : ",attendance[i])
Comments
Leave a comment