Question #60027

MIT, how to draw a flowchart of 2000 students which reads names,sex and score of each student and outputs the names of male student scored above 75%?

Expert's answer

Answer on Question #60027, Programming & Computer Science / Other Problem.

MIT, how to draw a flowchart of 2000 students which reads names, sex and score of each student and outputs the names of male student scored above 75%?

Solution.



http://www.AssignmentExpert.com/


students = []
for i in range(2000):
    name = input("Enter student name: ")
    sex = input("Enter student sex (M/F): ")
    score = float(input("Enter student score: "))
    students.append((name, sex, score))
male_students_above_75 = [student[0] for student in students if student[1] == 'M' and student[2] > 75]
print("Male students with score above 75%:")
for name in male_students_above_75:
    print(name)

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!

LATEST TUTORIALS
APPROVED BY CLIENTS