1 Star 0 Fork 0

zhao-shu-bo/czsf

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
7 2.10 KB
Copy Edit Raw Blame History
zhao-shu-bo authored 2021-10-29 16:44 +08:00 . add 7.
print('Hello')
print("Hello")
s = '\u0048\u0065\u006c\u006c\u006f'
print(s)
print("Hello'World")
print('Hello"World')
s = 'Hello\n World'
print(s)
s = 'Hello\u000a World'
print(s)
s = 'Hello\t World'
print(s)
s = 'Hello\' World'
print(s)
s = 'Hello\" World'
print(s)
s = 'Hello\\ World'
print(s)
s = 'Hello\n World'
print(s)
s = r'Hello\n World'
print(s)
s = """
《早发白帝城》
朝辞白帝彩云间,千里江陵一日还。
两岸猿声啼不住,轻舟已过万重山。
"""
print(s)
print(int("80"))
print(float("80.0"))
print(int("AB",16))
print(str(123))
money = 5834.5678
print(str(money))
print(str(True))
i = 32
s = 'i * i = ' + str(i * i)
print(s)
s = 'i * i = {}'.format(i * i)
print(s)
s = '{0} * {0} = {1}'.format(i,i * i)
print(s)
s = '{p1} * {p1} = {p2}'.format(p1=i,p2=i * i)
print(s)
money = 5834.5678
name = 'Tony'
print('{0:s}年龄{1:d},工资是{2:f}元。'.format(name,20,money))
print('{0}年龄{1},工资是{2:0.2f}元。'.format(name,20,money))
print('{0}今天收入是{1:G}元。'.format(name,money))
print('{0}今天收入是{1:g}元。'.format(name,money))
print('{0}今天收入是{1:e}元。'.format(name,money))
print('{0}今天收入是{1:E}元。'.format(name,money))
print('十进制数{0:d}的八进制表示为{0:o}'.format(18))
print('十进制数{0:d}的十六进制表示为{0:x}'.format(18))
s_str = 'Hello World'
print(s_str.find('e'))
print(s_str.find('l'))
print(s_str.find('l',4))
print(s_str.find('l',4,6))
text = 'AB CD EF GH IJ'
print(text.replace(' ','|',2))
print(text.replace(' ','|'))
print(text.replace(' ','|',1))
text = 'AB CD EF GH IJ'
print(text.split(' '))
print(text.split(' ',maxsplit=0))
print(text.split(' ',maxsplit=1))
print(text.split(' ',maxsplit=2))
wordstring = '''
it was the best of times it was the worst of times.
it was the age of wisdom it was the age of foolishness.
'''
wordstring = wordstring.replace('.',' ')
wordlist = wordstring.split()
wordfreq = []
for w in wordlist:
wordfreq.append(wordlist.count(w))
d = dict(zip(wordlist,wordfreq))
print(d)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhao-shu-bo/czsf.git
git@gitee.com:zhao-shu-bo/czsf.git
zhao-shu-bo
czsf
czsf
master

Search