Skip to content

Homework3#3

Open
facelli wants to merge 5 commits into
mainfrom
homework3
Open

Homework3#3
facelli wants to merge 5 commits into
mainfrom
homework3

Conversation

@facelli

@facelli facelli commented Dec 8, 2020

Copy link
Copy Markdown
Owner

No description provided.

Comment thread third_lesson/1-st_task.py
def func(arg1, arg2):
try:
return arg1 / arg2
except ZeroDivisionError as err:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

смотри, лучше это вынести за пределы функции и блок try - except использовать в объемлющей области:

try:
my_func()
except Exception as err:
бла бла бла

Comment thread third_lesson/2-nd_task.py
# Реализовать вывод данных о пользователе одной строкой.

def func(name, surname, borndate, homecity, email, phone):
print(f"Hello, {name} {surname}, i know all about you!\n Look, you was born in {borndate}, \nand you live in {homecity}, your phone number is {phone} and email is {email}.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

давай делать return строки, а печатать её за пределами функции

Comment thread third_lesson/3-d_task.py
return b + c
elif b < a and b < c:
return a + c
elif c < a and c < b:

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 third_lesson/4-th_task.py
z = x
for iter in range(y - 1):
x *= z
return x

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 third_lesson/5-th_task.py
break
summ += sum(map(int, data.split()))
print(f"Temporary sum value: {summ}")
return summ

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 third_lesson/6-th_task.py
# начинаться с заглавной буквы. Необходимо использовать написанную ранее функцию int_func().

def int_func(word):
return word.capitalize()

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