# 条件判断语句 # home ="America" # if home == "America": # print("Hello,America") # else: # print("Hello,China") #当条件不成立未False是 # home ="China" # if home == "America": # print("Hello,America") # else: # print("Hello,China") # 单独使用if语句 # home ="America" # if home == "America": # print("Hello,America") # 多个if语句: # x = 2 # # if x == 2: # # print("The number is 2.") # # if x % 2 ==0: # # print("The number is even .") # # if x % 2 != 0: # # print("The number is odd .") # if 语句中加入if语句:嵌套 # x = 10 # y = 11 # if x == 10: # if y ==11: # print(x + y)、 # home = "Thailand" # if home == "Japan": # print("Hello,Japan!") # print(100 > 10) #:请打印3个不同的字符串: # a = 1 # print(a) # b = "hello,word" # print(b) # c = "武汉加油,中国加油!" # print(c) # 如果变量小于10,打印一条信息;如果大于或等于10,则答应不同的信息 # s = 10 # if s < 10: # print("Hello,China") # else: # print("Hello,Wrold") # 如果变量的值小于或等于10.打印一条消息; # 如果大于10并且小于或等于25,则打印一条不同的信息; # 如果大于25,则打印另一条不同的而信息 # a = input("请你输入数字:") # a = 0 # int_a = int(a) # if a <= 10: # print("你中了!") # elif 10 < a <=25: # print("你也中了!") # else: # print("你没有中!") # 4.编写一个将两个变量相除。并打印余数的程序 # a = 13 # b = 3 # print(a/b) # 5.编写一个将两个变量相除。并打印商的程序 # a = 13 # b = 3 # print(a//b) # 6.为变量age赋予一个整数值,根据不同的数值打印不同的字符串说明 # age = 15 # age = "hello" # age = "武汉" # print(age)