Python语法基础,,# coding=u


# coding=utf-8
import random



teacher = (1 < 3) and (2 > 5)
print (teacher)

index = random.randint(1, 10)
print (index)

a = True * True
print ("a = " + str(a))

b = 5
print float(b)

print "type = " + str(type(b))

print isinstance(a, float)

c = 10
c %= 2
print "c = " + str(c)

d = 5;
print d or c

x, y = 4, 5

print x if x < y else y

jso
assert 3 < 4


menber = [‘葫芦娃‘,3.14,‘mm‘,‘dd‘,‘hh‘]
for i in menber:
print(i,len(menber))

for j in range(0,10):
print(-j)

menber.extend([‘1‘,‘2‘])
menber.insert(1,‘gggg‘)
print menber




print (‘------------------Edwin-------------------‘)
temp = input("不妨猜一下我现在心里想的是哪个数字:")
guess = int(temp)
while guess != 8:
temp = input("不妨猜一下我现在心里想的是哪个数字:")
guess = int(temp)
if guess == 8:
print ("我草,你是我心里的蛔虫吗?")
else:
if guess > 8:
print ("哥,大了大了~ ~");
else:
print ("嘿,小了!小了~~!")
print ("游戏结束,不玩啦")

Python语法基础

相关内容

    暂无相关文章

评论关闭