Вопрос задан 17.06.2023 в 18:26. Предмет Информатика. Спрашивает Невмержицкая Кристина.

Составить любые две программы на сложение на Python и скрин ​

0 0
Перейти к ответам

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

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

Ответ:

print("Addition of two complex numbers : ",(4+3j)+(3-7j))

print("Subtraction of two complex numbers : ",(4+3j)-(3-7j))

print("Multiplication of two complex numbers : ",(4+3j)*(3-7j))

print("Division of two complex numbers : ",(4+3j)/(3-7j))

Объяснение:

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

Program 1: Addition Program in Python

Here's a simple program that performs addition in Python:

```python # Addition Program num1 = 5 num2 = 10

# Add the numbers sum = num1 + num2

# Print the result print("The sum of", num1, "and", num2, "is", sum) ```

This program declares two variables `num1` and `num2` with values 5 and 10, respectively. It then adds the two numbers and stores the result in the variable `sum`. Finally, it prints the result using the `print()` function.

Program 2: Addition Program with User Input in Python

Here's another program that allows the user to input two numbers and performs addition in Python:

```python # Addition Program with User Input num1 = int(input("Enter the first number: ")) num2 = int(input("Enter the second number: "))

# Add the numbers sum = num1 + num2

# Print the result print("The sum of", num1, "and", num2, "is", sum) ```

In this program, the `input()` function is used to prompt the user to enter two numbers. The `int()` function is used to convert the user input from a string to an integer. The program then adds the two numbers and stores the result in the variable `sum`. Finally, it prints the result using the `print()` function.

Please note that the screenshots cannot be provided as they are not available in the search results. However, you can copy and run the code in a Python environment to see the output.

0 0

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

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

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

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