F-Strings decilamal places
#!/usr/bin/env python3
val = 12.3
print(f'{val:.2f}')
print(f'{val:.5f}')
F-Strings decilamal places
#!/usr/bin/env python3
val = 12.3
print(f'{val:.2f}')
print(f'{val:.5f}')
F-Strings decilamal places
#!/usr/bin/env python3
s1 = 'a'
s2 = 'ab'
s3 = 'abc'
s4 = 'abcd'
print(f'{s1:>10}')
print(f'{s2:>10}')
print(f'{s3:>10}')
print(f'{s4:>10}')
F-Strings decilamal places
#!/usr/bin/env python3
a = 300
# hexadecimal
print(f"{a:x}")
# octal
print(f"{a:o}")
# scientific
print(f"{a:e}")
F-Strings decilamal places
#!/usr/bin/env python3
for x in range(1, 11):
print(f'{x:02} {x*x:3} {x*x*x:4}')
F-Strings decilamal places
#!/usr/bin/env python3
import datetime
now = datetime.datetime.now()
print(f'{now:%Y-%m-%d %H:%M}')
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us