I came across a print statement with f strings which was as below:
a = "data"
print(f">{a:^10}<")
The output that i get out of this is as below:
> data <
What i would like to understand is the ^10 in the above print statement. Can someone explain?
^
is for center aligned, and 10
means the minimum width.
You can check the format string syntax here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.