I can print(‘#’*5) to >>> #####.
But if I try to do this with f-string like
a=5
print(f” ‘#’*{a}”)
I get >>> ‘#’*5.
Is this not possible, or what is my failure?
You can do:
a=5
print(f"{'#'*a}")
To get
#####
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With