File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212print (f"{ - 123456789.8765 :G} " )
1313print ("{:G}" .format (- 123456789.8765 ))
1414
15- infinite = 1e300 * 1e300
15+ infinite = float ( "inf" )
1616not_a_number = infinite * 0
1717print (f"{ infinite :g} " )
1818print (f"{ not_a_number :g} " )
Original file line number Diff line number Diff line change 1- # print(f" Hello, Pythonista!" )
1+ # print(f' Hello, Pythonista!' )
22# print(f"Hello, Pythonista!")
33
4- # print(f" Single-line f-string with single quotes" )
4+ # print(f' Single-line f-string with single quotes' )
55# print(f"Single-line f-string with double quotes")
66# print(
7- # f""" Multiline triple-quoted f-string
8- # with single quotes"""
7+ # f''' Multiline triple-quoted f-string
8+ # with single quotes'''
99# )
1010# print(
1111# f"""Multiline triple-quoted f-string
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def __repr__(self):
1111
1212
1313jane = Person ("Jane" , 25 )
14- f"{ jane !s} "
15- f"{ jane !r} "
16- "{jane!s}" .format (jane = jane )
17- "{jane!r}" .format (jane = jane )
14+ print ( f"{ jane !s} " )
15+ print ( f"{ jane !r} " )
16+ print ( "{jane!s}" .format (jane = jane ) )
17+ print ( "{jane!r}" .format (jane = jane ) )
You can’t perform that action at this time.
0 commit comments