Загрузка данных


discount = 0.60

print(f"{'Исходная цена':>15} | {'Скидка':>10} | {'Новая цена':>12}")

for price in [4.95, 9.95, 14.95, 19.95, 24.95]:
    discount_amount = price * discount
    new_price = price - discount_amount
    print(f"{price:>15.2f} | {discount_amount:>10.2f} | {new_price:>12.2f}")

bits = input("Введите 8 бит (например, 01010101): ")

ones = bits.count("1")

if ones % 2 == 0:
    parity_bit = "0"
else:
    parity_bit = "1"

print(f"Бит четности: {parity_bit}")
print(f"Полная последовательность: {bits}{parity_bit}")

total_price = 0

age_input = input("Введите возраст посетителя (или нажмите Enter для завершения): ")

while age_input != "":
    age = int(age_input)
    
    if age < 3:
        price = 0.00
    elif age <= 12:
        price = 14.00
    elif age <= 65:
        price = 23.00
    else:
        price = 18.00
    
    total_price += price
    age_input = input("Введите возраст посетителя (или нажмите Enter для завершения): ")

print(f"Общая стоимость билетов: ${total_price:.2f}")


total_points = 0
count = 0

grade = input("Введите оценку (или нажмите Enter для выхода): ")

while grade != "":
    grade = grade.upper()
    if grade == "A+" or grade == "A":
        points = 4.0
    elif grade == "A-":
        points = 3.7
    elif grade == "B+":
        points = 3.3
    elif grade == "B":
        points = 3.0
    elif grade == "B-":
        points = 2.7
    elif grade == "C+":
        points = 2.3
    elif grade == "C":
        points = 2.0
    elif grade == "C-":
        points = 1.7
    elif grade == "D+":
        points = 1.3
    elif grade == "D":
        points = 1.0
    elif grade == "F":
        points = 0.0
    else:
        points = 0.0

    total_points += points
    count += 1
    grade = input("Введите оценку (или нажмите Enter для выхода): ")

if count == 0:
    print("Оценки не были введены.")
else:
    average = total_points / count
    print(f"Средняя оценка: {average:.1f}")