-
Notifications
You must be signed in to change notification settings - Fork 0
Выполнение первого практического задания #1
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
Open
silverAndr
wants to merge
1
commit into
main
Choose a base branch
from
lesson1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # работаем с переменными | ||
| integer = 6 | ||
| string = 'str' | ||
| number = 5.0 | ||
| print(integer) | ||
| print(string) | ||
| print(number) | ||
| user_name = input('Как тебя зовут?') | ||
| print('Привет, ', user_name) | ||
| a = int(input('Введите a: ')) | ||
| b = int(input('Введите b: ')) | ||
| c = a + b | ||
| print('a + b = ', c) | ||
| user_name = input('Как тебя зовут?') | ||
| print('Привет, ', user_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Выводим время в формате чч:мм:сс | ||
| hours = 0 | ||
| minutes = 0 | ||
| sec = int(input('Введите время в секундах - ')) | ||
| if sec >= 60: | ||
| minutes = sec // 60 | ||
| sec = sec % 60 | ||
| if minutes >= 60: | ||
| hours = minutes // 60 | ||
| minutes = minutes % 60 | ||
| print(f'{hours:02}:{minutes:02}:{sec:02}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Ищем сумму чисел n + nn + nnn | ||
| num = input('введите целое число - ') | ||
| num1 = int(num) | ||
| num2 = int(num * 2) | ||
| num3 = int(num * 3) | ||
| result = num1 + num2 + num3 | ||
| print(num1, num2, num3, sep=' + ', end=f' = {result}') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Ищем самую большую цифру в числе | ||
| integer = int(input('Введите целое положительное число: ')) | ||
| maximum = 0 | ||
| if integer < 0: | ||
| print('число должно быть положительным') | ||
| else: | ||
| while(integer > 0) : | ||
| if integer % 10 > maximum: | ||
| maximum = integer % 10 | ||
| integer = integer // 10 | ||
| print(maximum) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # Определить, с каким финансовым результатом работает фирма | ||
| # Прибыль считаю по формуле [income - outlay] | ||
| # рентабельность - по формуле [income / outlay * 100] | ||
| income = int(input('Введите значение выручки в у.е.: ')) | ||
| outlay = int(input('Введите значение издержек в у.е.: ')) | ||
| if(income > outlay): | ||
| print('Фирма работает в прибыль!') | ||
| print(f'рентабельность {income / outlay * 100:.1f} %') | ||
| n_workers = int(input('Какая численность сотрудников? ')) | ||
| print(f'На каждого сотрудника приходится по {(income - outlay) / n_workers:.2f} у.е. прибыли') | ||
| else: | ||
| print('Фирма работает в убыток!') | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # задача про ежедневные пробежки | ||
| a = int(input('Сколько киллометров результат в первый день: ')) | ||
| b = int(input('Сколько киллометров надо пробежать: ')) | ||
| days = 1 | ||
| while a < b: | ||
| # print(f'{days}-й день: {a}') | ||
| days += 1 | ||
| a = a + a * 0.1 | ||
| print(f'на {days:.0f}-й день спортсмен достиг результата — не менее {b} км.') |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Рентабельность - это отношение прибыли к выручке, Прибыль - выручка минус издержки