Data representation using {}#
The {} notation inside the quote allows for changing data representations, like printing up to a certain decimal place, changing binary to decimal numbers, etc., without writing many lines of code.
Wrangling#
1original_number = 42
2print("The binary representation of 42 is - {0:b}".format(original_number))
The binary representation of 42 is - 101010
1print("{}".format("What is the question"))
2print("{:^42}".format("What is the question"))
3print("{:=^42}".format("What is the question"))
What is the question
What is the question
===========What is the question===========