+ 1

Want to know something new!

We know that in python this print("{:#>5}".format(9)) will print 4 '#'s and 9 at end! I want to do this: a=5 print("{:#>a}".format(9)) How to use it like that?

4th May 2018, 3:43 PM
Ă‡ĆŻĆ™ĂźĂ¶ĆŸ ĂŸÄ…ĆĄĂ€Ă±È› 🇼🇳
Ă‡ĆŻĆ™ĂźĂ¶ĆŸ ĂŸÄ…ĆĄĂ€Ă±È› 🇼🇳 - avatar
2 Answers
+ 2
Today i learn something new. a=5 a=('{:#>'+str(a)+'}') print(a.format(9))
4th May 2018, 4:15 PM
Maninder $ingh
Maninder $ingh - avatar
0
Alternative to Maninder Singh . a=5 print(('{:#>'+str(a)+'}').format(9)) #This will not change the value of a! #Thanks in between to give the idea!
4th May 2018, 7:17 PM
Ă‡ĆŻĆ™ĂźĂ¶ĆŸ ĂŸÄ…ĆĄĂ€Ă±È› 🇼🇳
Ă‡ĆŻĆ™ĂźĂ¶ĆŸ ĂŸÄ…ĆĄĂ€Ă±È› 🇼🇳 - avatar