码迷,mamicode.com
首页 > 编程语言 > 详细

python-20190707

时间:2019-08-15 12:36:20      阅读:85      评论:0      收藏:0      [点我收藏+]

标签:dea   wro   guess   can   input   ESS   inpu   ack   world   

‘‘‘print("hello world!")
print("123")

x=3
y=5
print("x乘以y=", x*y)

name = "alex li"
name2 = name
print(name,name2)
name = "jack"
print("what is the value of name2 now?")

print(u"我爱北京天安门")

death_age = 80
name = input("your name:")
age = input("your age:")
print("you can still live for ",death_age-int(age),"years")‘‘‘

‘‘‘age_xiaowei = 24
input("age = ")
if(int(age) < age_xiaowei:
print("No,you are wrong,just guess bigger")
else if (int(age) > age_xiaowei:
print("No,you are wrong,just guess smaller")
else if (int(age) == age_xiaowei:
print("you are right"))))‘‘‘


age_xiaowei = 24
guess_age=int(input("guess_age:"))
if guess_age == age_xiaowei: #if后面接条件,必须注意的是,条件后必须带冒号
print("you are right")
else: #与if一样,else后面接条件,条件后必须带冒号
print("you are wrong") #在python中,用相同的缩进代表同一级别的代码

‘‘‘age_xiaowei = 24
guess_age = int(input("age = "))
if guess_age < age_xiaowei:
print("No,you are wrong,just guess bigger")
elif guess_age > age_xiaowei: #在python中,elseif必须写成elif
print("No,you are wrong,just guess smaller")
else:
print("you are right")‘‘‘

python-20190707

标签:dea   wro   guess   can   input   ESS   inpu   ack   world   

原文地址:https://www.cnblogs.com/zxw2016208120/p/11357085.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!