Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

домашнее задание к 1му уроку#457

Open
sawk1 wants to merge 4 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
sawk1:mastersawk1/Python_lessons_basic:masterCopy head branch name to clipboard
Open

домашнее задание к 1му уроку#457
sawk1 wants to merge 4 commits into
GeekBrainsTutorial:masterGeekBrainsTutorial/Python_lessons_basic:masterfrom
sawk1:mastersawk1/Python_lessons_basic:masterCopy head branch name to clipboard

Conversation

@sawk1

@sawk1 sawk1 commented Jan 18, 2019

Copy link
Copy Markdown

No description provided.

while i<p:
print(b[i])
i=i+1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужна еще арифметика

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не понимаю, что имеется в виду под арифметикой, нужны операции сложения/вычитания с цифрами числа?

b[0:1] = [per1,per2]
print('значение первой переменной изменилось на : ',b[1])
print ('значение первой переменной изменилось на : ', b[0])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

срезы мы еще не проходили. рано. решаем только на основе того, что было
dop_numb = a
a = b
b = dop_numb

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

изменил

if age >= 18 :
print('Доступ разрешен')
else:
print ('Извините, пользование данным ресурсом только с 18 лет') No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хорошо

elif b[i]>b[i+1] :
b[i+1] = b[i]
i = i+1
print(b[n-1])

@DmitryChitalov DmitryChitalov Jan 22, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

можно совсем коротко
number = input("Введите число: ")
print(max(number))

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

да, как я уже узнал - в питоне есть встроенные операции со списками, такие как max и .sort(), в этой программе я как раз занимался сортировкой списка, правда в обратно порядке, и согласен, что встроенные функции сильно укорачивают и упрощают код

per1 = per1 + per2
print('значение первой переменной изменилось на : ',per1[len(per1)-len(per2):len(per1)])
print ('значение первой переменной изменилось на : ', per1[0:len(per1)-len(per2)])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хорошо. можно совсем коротко
a, b = b, a

x1 = -b/(2*a)
print('x1=x2', x1)
else:
print('уравнение не имеет корней') No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

все верно

Comment thread lesson01/home_work/hw01_hard.py Outdated
if True:
a>999999
if True:
print('задача решена!')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

супер

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.