Advertisement
Spocoman

Online Education

Sep 23rd, 2023 (edited)
1,141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. online_students = 0
  2. onsite_students = 0
  3.  
  4. for i in range(3):
  5.     education_form = input()
  6.     student_count = int(input())
  7.  
  8.     if education_form == "online":
  9.         online_students += student_count
  10.     else:
  11.         onsite_students += student_count
  12.  
  13.     if onsite_students > 600 :
  14.         online_students += onsite_students - 600
  15.         onsite_students = 600
  16.  
  17. print(f"Online students: {online_students}\n"
  18.       f"Onsite students: {onsite_students}\n"
  19.       f"Total students: {online_students + onsite_students}")
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement