Answer to Question #265956 in Python for Rushikesh

Question #265956

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%.


1
Expert's answer
2021-11-15T00:23:32-0500
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])

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS