#๐Ÿ”’ Python Aligning Issue

7 messages ยท Page 1 of 1 (latest)

stone crestBOT
#

@carmine sun

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

carmine sun
#
print("Akali Metals:")
print()
print("{0:<15} {1:<10} {2:^25} {3:>15}".format("Element", "Symbol", "Atomic number", "Atomic weight"))
print("{0:<15} {1:<10} {2:^25} {3:>15.4f}".format("Lithium", "Li", 3, 6.94))
print("{0:<15} {1:<10} {2:^25} {3:>15.4f}".format("Sodium", "Na", 11, 22.990))
print("{0:<15} {1:<10} {2:^25} {3:>15.4f}".format("Potassium", "K", 19, 39.098))
print("{0:<15} {1:<10} {2:^25} {3:>15.4f}".format("Rubidium", "Rb", 37, 85.468))
print("{0:<15} {1:<10} {2:^25} {3:>15.4f}".format("Caesium", "Cs", 55, 132.905))
print("{0:<15} {1:<10} {2:^25} {3:>15.4f}".format("Francium", "Fr", 87, 223))

CODE IS ABOVE^^
https://paste.pythondiscord.com/NVRA

#

the left is the expected outcome and the right is the outcome i got with mistakes

#

its aligned wrong and i cant figure out why

#

this is the task

#

how thne code looks in vsc

stone crestBOT
#

@carmine sun

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.