import user_profile as up

user_profile = up.build_profile('albert', 'einstein', location='princeton',
	field='physics')

print(user_profile)
Beispiel #2
0
from user_profile import build_profile
from user_profile import *

her = build_profile('Zhang', 'Ting', sex="female", age="26")
print(her)
make_car('BMW', 'big', color='yellow', cost='200000')
Beispiel #3
0
import user_profile as up

user_profile = up.build_profile('albert',
                                'einstein',
                                location='princeton',
                                field='physics')

my_profile = up.build_profile('gerry',
                              'maguire',
                              age=35,
                              date_of_birth='30/01/1985',
                              occupation='devops engineer')

ellie_profile = up.build_profile('ellie',
                                 'maguire',
                                 age=14,
                                 gendor='femaile',
                                 date_of_birth='30/05/2005')

print(user_profile)
print("\n")
print(my_profile)
print("\n")
print(ellie_profile)
print("\n")

ellie_age = ellie_profile['age']
print(f"Ellie's age is: {ellie_age}")
Beispiel #4
0
from user_profile import build_profile

infor = build_profile('june', 'wang', location='beijing', date='11.29')
print(infor)
Beispiel #5
0
# @Software: Sublime Text

# ------------------ example01 ------------------
"""
8-16 导入:选择一个你编写的且只包含一个函数的程序,并将这个函数放在另一个文件中。在主程序文件中,使用下述各种方法导入这个函数,再调用它:
    import module_name
    from module_name import function_name
    from module_name import function_name as fn
    import module_name as mn
    from module_name import *

    8-13 用户简介:复制前面的程序 user_profile.py,在其中调用 build_profile()来创建有关你的简介;调用这个函数三次,每次都提供不同数量的实参。
"""
import user_profile

user_profile1 = user_profile.build_profile('san', 'zhang')
print(user_profile1)
user_profile2 = user_profile.build_profile('san', 'zhang', location='beijing')
print(user_profile2)
user_profile3 = user_profile.build_profile('san',
                                           'zhang',
                                           location='beijing',
                                           field='programming')
print(user_profile3)

print("-" * 20)

from user_profile import build_profile

user_profile1 = build_profile('san', 'zhang')
print(user_profile1)
Beispiel #6
0
# _*_ coding :UTF-8 _*_
# 开发人员:C
# 开发时间:2019/4/26 10:04
# 文件名称:function13.py
# 开发软件:PyCharm
from user_profile import build_profile

my_information = build_profile('cui',
                               'yaxie',
                               height='173cm',
                               weight='55kg',
                               field='conterl engineering')
print(my_information)