965-Python-Learning-Repo/datatype_info.py
2023-02-27 15:31:20 +08:00

11 lines
548 B
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

print("1024 * 768 = " + str(1024*768) )
print(r'')
'''
转义字符\可以转义很多字符,比如\n表示换行,\t表示制表符,字符\本身也要转义,所以\\表示的字符就是\
如果字符串里面有很多字符都需要转义,就需要加很多\为了简化Python还允许用r''表示''内部的字符串默认不转义
如果字符串内部有很多换行,用\n写在一行里不好阅读为了简化Python允许用''''''的格式表示多行内容
'''
r = (85 - 72) / 72 * 100
print(f'{r:.1f}%')