"""
这是Python的多行注释
"""
g_num
a,b = b,a
print(1.01**365)
a = input("请输入密码:")
print(a)
%s
%d
%f
%%
print("*",end="")
print("")
print("*",end="---")
print("*")
age = 16
if age >=18:
print("你已经成年")
else:
print("你还没成年")
is_employee = True;
if not is_employee:
print("非本公司人员")
holiday_name = "生日"
if holiday_name == "情人节":
print("买玫瑰")
elif holiday_name == "平安夜":
print("吃苹果")
elif holiday_name == "生日":
print("买蛋糕")
else:
print("每天都是节日呀")
a = 16
holiday_name = "生日"
if holiday_name == "生日":
if a >=18:
print("买玫瑰")
else:
print("吃苹果")
i = 1
while i <=5:
print("hello,Python")
i = i + 1;
print("循环结束后的 i = %d" % i)
for num in [1,2,3]:
print(num)
if num == 2:
break
else:
print("你好")
import random
a = random.randint(12,20)
print(a)
def sum(num1,num2):
"""对两个数字求和"""
result = num1 + num2
print("%d + %d = %d" % (num1,num2,result))
if __name__ == '__main__':
sum(10,20)
def dayin():
print("-"*50)
"""
打印横线模块.py 是自己创建的文件
"""
import 打印横线模块
打印横线模块.dayin()
def demo(num,*args,**kwargs):
print(num)
print(args)
print(kwargs)
if __name__ == '__main__':
demo(1,2,3,4,name="小明",age=18,gender=True)
def demo(num,*nums,**person):
print(num)
print(nums)
print(person)
if __name__ == '__main__':
demo(1,2,3,4,name="小明",age=18,gender=True)