3.7python作业

# 2-1
msg = "aa"
print(msg)

# 2-2
msg = 'aaa'
print(msg)
msg = 'bbb'
print(msg)


#2-3
name =  "Control_xu"
print("Hello " + name + ", how are you?")


#2-4
name = 'Donald trump'
print(name.upper())
print(name.lower())
print(name.title())

# 2-5 and 2-6
name = "雷锋"
msg = '为人民服务'
print(name +' once said,"' + msg + '."')

# 2-7
name = '\t  Donald Trump  \n'
print(name)
print(name.strip())
print(name.lstrip())
print(name.rstrip())


# 2-8
# 输出48
print(1+7)
print(2*4)
print(round(16/2))
print(9-1)

# 2-9
my_favorite_num = 0.66666
print("my favorite number is " + str(my_favorite_num))


你可能感兴趣的:(作业)