Added Homework 04 - Strings
This commit is contained in:
parent
aad4e226c5
commit
be356ccb59
24 changed files with 315 additions and 0 deletions
11
homework/homework04/fstrings/fstrings04.py
Normal file
11
homework/homework04/fstrings/fstrings04.py
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
variable = 1200356.8796
|
||||
|
||||
print(f"Using Numeric {variable = }")
|
||||
print(f"With two decimal places: {variable:.2f}")
|
||||
print(f"With four decimal places: {variable:.3f}")
|
||||
print(f"With two decimal places and a comma: {variable:,.2f}")
|
||||
print(f"With a forced plus sign: {variable:+.2f}\n")
|
||||
|
||||
variable *= -1
|
||||
print(f"Using Numeric {variable = }")
|
||||
print(f"With two decimal places and a comma: {variable:,.2f}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue