Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions task_1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
number_1 = 20
print(number_1)

user_name = input('Введите ваше имя: ')
user_age = input('Введите ваш возраст: ')
user_residence = input('Ваше место жительства: ')

print('Вас зовут - {}.Вам {} лет. Вы живете в {}.' .format(user_name, user_age, user_residence))
5 changes: 5 additions & 0 deletions task_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
time = int(input('Введите время в секундах: '))
hours = time//3600
minutes = time//60 - hours*60
seconds = time - hours*3600 - minutes*60
print('{}:{}:{}'.format(hours, minutes, seconds))
7 changes: 7 additions & 0 deletions task_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
n = int(input('Введите число n: '))
n = str(n)
number = int(n)
nn = int(n + n)
nnn = int(n + n + n)
result = number + nn + nnn
print('n + nn + nnn = {}'.format(result))
16 changes: 16 additions & 0 deletions task_4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
user_number = input('Enter a positive integer: ')
total_number = []
i = 0

while i < len(user_number):
total_number.append(user_number[i])
i += 1
total_number = [int(x) for x in total_number]

max_number = total_number[0]
i = 1
while i < len(total_number):
if max_number < total_number[i]:
max_number = total_number[i]
i += 1
print('The biggest number in {} is {}.' .format(user_number, max_number))
23 changes: 23 additions & 0 deletions task_5.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
income = float(input("Enter your company's income in the last year: "))
costs = float(input("Enter your company's costs in the last year: "))

if costs > income:
loss = costs - income
print('Your company ended the year at a loss of ${:.2f}.' .format(loss))
elif costs == income:
profit = income - costs
print('Your company ended the year with profit of ${:.2f}.' .format(profit))
elif costs < income:
profit = income - costs
print('Your company ended the year with profit of ${:.2f}.'.format(profit))
sales_margin = income/profit
print("Your company's sales margin in the last year was {:.2f}." .format(sales_margin))

staff_strength = int(input('Enter the number of employees in your company: '))
profit_per_emp = profit/staff_strength
print('The profit per one employee equals ${:.2f}.' .format(profit_per_emp))





14 changes: 14 additions & 0 deletions task_6.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
a = int(input('Введите результат за первый день: '))
b = int(input('Введите плановый результат: '))
i = 2
while True:
a = a*(1+0.1)
if a >= b:
break
i += 1
print('Результат не менее {} км был достигнут за {} дней.' .format(b, i))