1. 程式人生 > >字符串操作練習

字符串操作練習

分享 put clas pri src color form 技術分享 生產

for i in range (12):
    print(chr(9800+i),end="  ")

? ? ? ? ? ? ? ? ? ? ? ?

s = input("請輸入,明文密碼:")
for i in s:
    if ord("a") <= ord(i) <= ord("z"):
        print(chr(ord("a") + (ord(i) - ord("a") + 3) % 26),end=‘‘)
    else:
        print(i,end=‘‘)

請輸入,明文密碼:abc123789xyz

def456012abc

print(中華人民共和國國內生產總值(GDP):{0:,.2f}億元({1}年).format(689136.89,"2015"))

中華人民共和國國內生產總值(GDP):689,136.89億元(2015年)

for x in range(1,10):
    for y in range(1,x+1):
        print({}x{}={}.format(x,y,x*y),end= )
    print(\n)

技術分享

字符串操作練習