-
Notifications
You must be signed in to change notification settings - Fork 73
Add files via upload #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add files via upload #119
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 1. Поработайте с переменными, | ||
# создайте несколько, | ||
# выведите на экран. | ||
# Запросите у пользователя некоторые числа и строки и сохраните в переменные, | ||
# затем выведите на экран. | ||
|
||
a = 10 | ||
b = 15 | ||
print(f"Переменные a и b - {a} {b} ") | ||
word_1 = input("Введите первое слово: ") | ||
num_1 = int(input("Введите первое число: ")) | ||
word_2 = input("Введите второе слово: ") | ||
num_2 = int(input("Введите второе число: ")) | ||
print(f"Ваш ввод: {word_1} {num_1} {word_2} {num_2}") | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 2. Пользователь вводит время в секундах. | ||
# Переведите время в часы, минуты, секунды и выведите в формате чч:мм:сс. Используйте форматирование строк. | ||
|
||
user_seconds = int(input("Введите количество секунд: ")) | ||
hours = user_seconds // 3600 | ||
minutes = (user_seconds - (hours * 3600)) // 60 | ||
seconds = user_seconds - (hours * 3600) - (minutes * 60) | ||
print(f"Время в формате чч:мм:сс будет - {hours}:{minutes}:{seconds}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. выполнено |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# 3. Узнайте у пользователя число n. | ||
# Найдите сумму чисел n + nn + nnn. | ||
# Например, пользователь ввёл число 3. Считаем 3 + 33 + 333 = 369. | ||
|
||
num = int(input("Введите число 'n' для операции: ")) | ||
num_sum = (num + int(str(num) + str(num)) + int(str(num) + str(num) + str(num))) | ||
print("Сума n + nn + nnn будет: ", num_sum) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (num + int(str(num) + str(num)) + int(str(num) + str(num) + str(num))) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Принято. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# 4. Пользователь вводит целое положительное число. | ||
# Найдите самую большую цифру в числе. | ||
# Для решения используйте цикл while и арифметические операции. | ||
|
||
number = int(input("Введите целое положительное число ")) | ||
final_max = 0 | ||
while number != 0: | ||
current_number = number % 10 | ||
if final_max < current_number: | ||
final_max = current_number | ||
number = number // 10 | ||
print(f"Максимальная цифра во введенном числе: {final_max}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. выполнено |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 5. Запросите у пользователя значения выручки и издержек фирмы. | ||
# Определите, с каким финансовым результатом работает фирма. | ||
# Например, прибыль — выручка больше издержек, | ||
# или убыток — издержки больше выручки. | ||
# Выведите соответствующее сообщение. | ||
# 6. Если фирма отработала с прибылью, вычислите рентабельность выручки. | ||
# Это отношение прибыли к выручке. | ||
# Далее запросите численность сотрудников фирмы | ||
# и определите прибыль фирмы в расчёте на одного сотрудника. | ||
|
||
money = int(input("Введите выручку фирмы: ")) | ||
loss = int(input("Введите затраты фирмы: ")) | ||
profit = money - loss | ||
|
||
if profit > 0: | ||
print(f"фирама работает с прибылью: {profit}") | ||
print(f"вычислим рентабельность") | ||
ren = (profit / money) * 100 | ||
print(f" рентабельность фирмы {ren} %") | ||
ren_people = int(input("Введите количество сотрудников фирмы: ")) | ||
ren_people = ren / ren_people | ||
print(f"Один сотрудник приносит фирме: {ren_people} % ") | ||
elif profit < 0: | ||
print(f"Убыток фирмы равен {profit}") | ||
else: | ||
print(f"фирма работает на нуле") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. выполнено |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 7. Спортсмен занимается ежедневными пробежками. | ||
# В первый день его результат составил a километров. | ||
# Каждый день спортсмен увеличивал результат на 10% относительно предыдущего. | ||
# Требуется определить номер дня, | ||
# на который результат спортсмена составит не менее b километров. | ||
# Программа должна принимать значения параметров a и b | ||
# и выводить одно натуральное число — номер дня. | ||
|
||
a = int(input("Введите результат спортсмена в первый день: ")) | ||
b = int(input("Введите целевой результат: ")) | ||
day = 1 | ||
while a < b: | ||
a = a * 1.1 | ||
day = day + 1 | ||
print(f"Результат на {day} день тренировок: {a}") | ||
|
||
print(f"На {day} день спортсмен достигнет целевой результат и он составит {a}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. выполнено |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
выполнено