Новая Школа - онлайн-школа подготовки к ЕГЭ
Задача Задача №2648216
А
Аноним
20 января 2025 10:15 · публичный вопрос
А
Аноним

markc{ Оля :223 Маша :254 Нина :270 Pr = input (ведите проходной балл) for k, v in ball. items() : if v=or: print (v)

Ответ нейросети
20 января 2025 10:15

It looks like you're trying to write a Python program to compare student scores against a passing score and print out the students who have scores greater than or equal to that passing score. However, there are some syntax errors and issues in your code. Here's a corrected version of this code:

# Dictionary of student names and their scores
marks = { 
    "Оля": 223,
    "Маша": 254,
    "Нина": 270
}

# Input for the passing score
Pr = int(input("Введите проходной балл: ")) 

# Iterate through the dictionary and print names of students who meet or exceed the passing score
for name, score in marks.items():
    if score >= Pr:
        print(name)

Key Corrections:

  1. Dictionary Name: Changed ball to marks to match the defined dictionary.
  2. Comparison Operator: Changed the assignment operator = to the comparison operator >= in the condition.
  3. Proper Indentation: Ensured that the code is correctly indented, which is important in Python.
  4. Input Conversion: Converted the input for the passing score to an integer using int().

You can run this code in a Python environment, and it will prompt you to enter a passing score and then output the names of students who scored at or above that score.