Closed lzblack closed 2 years ago
Hi Professor, I just fixed this. Please let me know whether this is okay:) Thank you!
You are still using .format()
which can be replaced by using f-string. i.e.
var = (89-82)/82*100
print(f'{var:.2f}')
Got it, thank you professor! Here are my updates: var = '{:.2f}'.format((89-82)/82100) print(f'{var}%') or var = (89-82)/82100 print(f'{var:.2f}%')
Good job!
Please use f-strings: https://github.com/michael4227/OIM3640/blob/d3c2fbb969c3b2f111c4a9f8803538852b5aa394/session03/calc_2.py#L23 https://github.com/michael4227/OIM3640/blob/d3c2fbb969c3b2f111c4a9f8803538852b5aa394/session03/calc_2.py#L26