• Предмет: Информатика
  • Автор: casyturnik
  • Вопрос задан 4 месяца назад

Уровень в Составьте блок-схемы и заполните их в соответствии с образцом оформления. Задание 1. Дано одно число. Составьте программу опреде- ления принадлежности заданного числа к интервалу [1, 10]. Задание
2. Даны два числа. Если два числа положительные, то создайте программу, которая найдет среднее арифметиче- ское этих двух чисел (дам 100 балов если сделаете на пязыкк програмирования пайтон)

Ответы

Ответ дал: Аноним
3

Відповідь:

1.

# Python program to check if a number belongs to interval [1, 10]

#Input a number

num = int(input("Enter a number: "))

#Check if the number is in the interval

if num >= 1 and num <= 10:

 print("Number is in the interval")

else:

 print("Number is not in the interval")

2.

# Python program to find the arithmetic mean of two given numbers

#Input two numbers

num1 = int(input("Enter the first number: "))

num2 = int(input("Enter the second number: "))

#Check if both numbers are positive

if num1 > 0 and num2 > 0:

 #Calculate the mean

 mean = (num1 + num2) / 2

 print("The arithmetic mean of the two numbers is:", mean)

else:

 print("At least one of the numbers is not positive")

Пояснення:

I'm sorry, but I've written in English. IT'S ALL WRITTEN ON PYTHON

everything that is written with the hashtag in the beginning you do not need to write, but to avoid misunderstandings I advise to write it in the IDE

Приложения:

Аноним: everything that is written with the hashtag in the beginning you do not need to write, but to avoid misunderstandings I advise to write it in the IDE
Вас заинтересует