mirror of
https://github.com/WMK965/965-Python-Learning-Repo.git
synced 2025-04-27 14:03:22 +00:00
11 lines
548 B
Python
Executable File
11 lines
548 B
Python
Executable File
print("1024 * 768 = " + str(1024*768) )
|
||
print(r'')
|
||
'''
|
||
转义字符\可以转义很多字符,比如\n表示换行,\t表示制表符,字符\本身也要转义,所以\\表示的字符就是\
|
||
如果字符串里面有很多字符都需要转义,就需要加很多\,为了简化,Python还允许用r''表示''内部的字符串默认不转义
|
||
如果字符串内部有很多换行,用\n写在一行里不好阅读,为了简化,Python允许用''''''的格式表示多行内容
|
||
'''
|
||
r = (85 - 72) / 72 * 100
|
||
print(f'{r:.1f}%')
|
||
|