QUIZ_PYTHON Telegram 3927
В Format Mini-Language есть еще фокусы:


memory = 1.5e9 # 1.5 GB в байтах

# Выравнивание и заполнение
print(f"Memory (right aligned): {memory / 1e9:>10.2f} GB") # выравнивание по правому краю
print(f"Memory (left aligned): {memory / 1e9:<10.2f} GB") # выравнивание по левому краю
print(f"Memory (centered): {memory / 1e9:^10.2f} GB") # центрирование
print(f"Память: {memory / 1e9:010.2f} GB") # заполнение нулями

# Группировка цифр
print(f"Память: {memory:,.0f} байт(-ов)") # разделение запятыми
👍2👎1



tgoop.com/quiz_python/3927
Create:
Last Update:

В Format Mini-Language есть еще фокусы:


memory = 1.5e9 # 1.5 GB в байтах

# Выравнивание и заполнение
print(f"Memory (right aligned): {memory / 1e9:>10.2f} GB") # выравнивание по правому краю
print(f"Memory (left aligned): {memory / 1e9:<10.2f} GB") # выравнивание по левому краю
print(f"Memory (centered): {memory / 1e9:^10.2f} GB") # центрирование
print(f"Память: {memory / 1e9:010.2f} GB") # заполнение нулями

# Группировка цифр
print(f"Память: {memory:,.0f} байт(-ов)") # разделение запятыми

BY Python: задачки и вопросы


Share with your friend now:
tgoop.com/quiz_python/3927

View MORE
Open in Telegram


Telegram News

Date: |

Telegram Channels requirements & features SUCK Channel Telegram How to Create a Private or Public Channel on Telegram? While some crypto traders move toward screaming as a coping mechanism, many mental health experts have argued that “scream therapy” is pseudoscience. Scientific research or no, it obviously feels good. Administrators
from us


Telegram Python: задачки и вопросы
FROM American