第五周作业
3.13
s.upper(): PYTHON STRING
s.lower(): python string
s.find('i'): 10
s.replace: Python Strgni
s.split(' '): ['Ptyhon', 'String']
3.14
Length:23.88
3.15
print (format(389,'b')) #110000101
print (format(389,'o')) #605
print (format(389,'d')) #389
print (format(389,'x')) #185
print (format(389,'c')) #b 'c'改为'C'则为B
3.6
from time import *
scale = 36
start = perf_counter()
print("执行开始".center(scale//2,"-"))
for i in range(scale+1):
a = '.' * i
b = (i/scale) * 100
after = perf_counter() - start
if i < scale:
print("\r{:^3.0f}% Starting{} {:.2f}".format(b,a,after),end='')
else:
print("\r{:^3.0f}% Starting{}Done! {:.2f}".format(b,a,after))
sleep(0.05)
print("\n执行结束".center(scale//2,"-"))
3.7
while True:
for i in ["/" , "-", "|", "\", "|"]:
print("%s\r" % i , end = '')
3.8
tqdmbBar.py
from tqdm import tqdm
from time import sleep
for i in tqdm(range(1,100)):
sleep(0.01)

浙公网安备 33010602011771号