Вопрос задан 15.06.2023 в 01:57. Предмет Информатика. Спрашивает Степанов Степан.

Помогите у меня выдает ошибку a=int(input("a=")) b=int(input("b=")) c=int(input("c=")) k1=0;k2=0

l=0; k=100 if a==l or b==l or c==l : k1=k1 + 1 if a==k or b==k or c==k : k2=k2 + 1 if k1>0 and k2>0: print("3") else: if k2>0 : print("2") print("2") if k1>0: print("1")
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Гавриленко Филипп.

Ответ:

По синтаксису вижу, что это python.

Во первых я не очень понимаю смысл кода.

Во вторых я думаю вы не изучили конструкцию if elif else, так как вы не используете elif.

В третих в этом коде

else:

if k2>0 : print("2")

print("2")

if k1>0: print("1")

Я не понимаю смысл print("2") два раза. Возможно из-за того, что я не понимаю смысл кода.

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Error in Code

It seems like you are encountering an error in your code. Let's break it down and identify the issue.

The code you provided seems to be a Python script for which you are encountering an error. The error might be related to the logic or syntax of the code. Let's analyze the code step by step to identify the issue.

Code Analysis

```python a = int(input("a=")) b = int(input("b=")) c = int(input("c=")) k1 = 0 k2 = 0 + l = 0 k = 100 if a == l or b == l or c == l: k1 = k1 + 1 if a == k or b == k or c == k: k2 = k2 + 1 if k1 > 0 and k2 > 0: print("3") else: if k2 > 0: print("2") print("2") if k1 > 0: print("1") ```

Error Identification

Upon analyzing the code, it seems that there are a few issues with the syntax and logic. The addition of `0 + l = 0` seems to be a syntax error, and the logic within the if-else conditions might not be achieving the intended outcome.

Proposed Solution

To address the error, the code needs to be revised to ensure correct syntax and logic. It's important to clarify the intended functionality of the code to provide an accurate solution. If you could provide more details about the expected behavior of the code, I can assist in correcting the errors.

Feel free to provide more information about the expected behavior, and I can help you troubleshoot the code further!

0 0

Похожие вопросы

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос