Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 01. Read Text
- line = input()
- while line != "Stop":
- print(line)
- line = input()
- ==========================================
- 02. Password
- username = input()
- reg_pass = input()
- current_pass = input()
- while current_pass != reg_pass:
- current_pass = input()
- print("Welcome " + username + "!")
- ==========================================
- 03. Sum Numbers
- init_num = int(input())
- sum = 0
- while sum < init_num:
- current_num = int(input())
- sum = sum + current_num
- print(sum)
- ==========================================
- 04. Sequence 2k+1
- n = int(input())
- current_num = 1
- while current_num <= n:
- print(current_num)
- current_num = current_num * 2 + 1
- ==========================================
- 05. Account Balance
- input_line = input()
- balance = 0
- while input_line != "NoMoreMoney":
- amount = float(input_line)
- if amount < 0:
- print("Invalid operation!")
- break
- balance = balance + amount
- print(f"Increase: {amount:.2f}")
- input_line = input()
- print(f"Total: {balance:.2f}")
- ==========================================
- 06. Max Number
- import sys
- line = input()
- max_num = -sys.maxsize
- while line != "Stop":
- current_num = int(line)
- if current_num > max_num:
- max_num = current_num
- line = input()
- print(max_num)
- ==========================================
- 07. Min Number
- import sys
- line = input()
- min_num = sys.maxsize
- while line != "Stop":
- current_num = int(line)
- if current_num < min_num:
- min_num = current_num
- line = input()
- print(min_num)
- ==========================================
- 08. Graduation
- student_name = input()
- year = 1
- sum = 0
- fail_count = 0
- while year <= 12:
- if fail_count > 1:
- break
- grade = float(input())
- if grade < 4:
- fail_count += 1
- continue
- sum = sum + grade
- year += 1
- if fail_count > 1:
- print(f"{student_name} has been excluded at {year} grade")
- else:
- avg_grade = sum / 12
- print(f"{student_name} graduated. Average grade: {avg_grade:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement