Pyhont 学习随笔
utf-8 是uicode 的升级
索引 ---切片
常用操作方法
shift + ctrl + F10 = run
while 循环
while True:
print(1)
如何终止循环
n = True
while n:
print(111)
print(222)
2.格式化输出
2. %% 百分号
4. 编码的初识
1. 编码:密码本:二进制与英文字母,数字,特殊字符的对应关系。
count = 1
while count < 4:
num = int(input('请输入数字:'))
if num > 66:
print('猜大了')
elif num < 66:
print('猜小了')
else:
print ('恭喜你猜对了')
count +=1
count = 1
while count < 4:
num = int(input('请输入数字:'))
if num > 66:
print('猜大了')
elif num < 66:
print('猜小了')
else:
print ('恭喜你猜对了')
break
count +=1
else:
print('太笨了'
count = 1
while count < 11:
if count == 7:
print('')
else:
print(count)
count += 1
count = 1
while count < 11:
if count == 7:
pass
else:
print(count)
count += 1
count = 1
while count < 11:
if count == 7:
count +=1
print(count)
count += 1
count = 0
while count < 10:
count += 1
if count == 7:
continue
print(count)
count = 1
s = 0
while count < 100:
s += count
count += 1
print(s)

count = 1
s = 0
while count < 100:
if count % 2 == 0:
s = s - count
else:
s = s + count
count += 1
print(s)
浙公网安备 33010602011771号