-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask2.py
27 lines (17 loc) · 957 Bytes
/
task2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# solution # 1
def print_user_info(name, surname, birthday, city, email, phone):
fstr = f'user info: name: "{name}", surname: "{surname}", birthday: "{birthday}", city: "{city}", ' \
f'email: "{email}", phone: "{phone}"'
print(fstr)
# # solution with args
def print_user_info_args(*args):
print_user_info(*args)
# solution with kwargs
def print_user_info_kwargs(**kwargs):
print_user_info(**kwargs)
print_user_info(phone='+79629747326', surname='Masterenko', name='Ivan', birthday='16.09.1985', city='Moscow',
email='[email protected]')
print_user_info('Ivan', 'Masterenko', '16.09.1985', 'Moscow', '[email protected]', '+79629747326')
print_user_info_args('Ivan', 'Masterenko', '16.09.1985', 'Moscow', '[email protected]', '+79629747326')
print_user_info_kwargs(surname='Masterenko', birthday='16.09.1985', city='Moscow',
email='[email protected]', phone='+79629747326', name='Ivan')