diff --git a/task_1.py b/task_1.py new file mode 100644 index 0000000..47e3c33 --- /dev/null +++ b/task_1.py @@ -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)) diff --git a/task_2.py b/task_2.py new file mode 100644 index 0000000..e61c4b7 --- /dev/null +++ b/task_2.py @@ -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)) diff --git a/task_3.py b/task_3.py new file mode 100644 index 0000000..e769979 --- /dev/null +++ b/task_3.py @@ -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)) diff --git a/task_4.py b/task_4.py new file mode 100644 index 0000000..856b219 --- /dev/null +++ b/task_4.py @@ -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)) diff --git a/task_5.py b/task_5.py new file mode 100644 index 0000000..bdd60dc --- /dev/null +++ b/task_5.py @@ -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)) + + + + + diff --git a/task_6.py b/task_6.py new file mode 100644 index 0000000..340d2a9 --- /dev/null +++ b/task_6.py @@ -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)) + + + + +