Pyhont 学习随笔

utf-8  是uicode 的升级

unicode :万国

偶数对2取余等于0

 

编程刚开始是模仿

第二阶段 可以更改

第三个阶段自我创造

 

 

ctrl + z 撤销返回上一步

 

continue 退出本次循环,继续下一次循环

 

where 你需要重复之前的动作,输入用户名密码,考虑到while循环

 

== 比较运算符 = 赋值运算符

 

 

 

 

 

 

索引  ---切片

常用操作方法

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)

 

 



posted @ 2022-08-12 11:03  safetly  阅读(32)  评论(1)    收藏  举报