Created
May 31, 2016 17:08
-
-
Save horvatha/2a25d9a27606d5cdf9a972f7af5ede20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PEP 498 -- Literal String Interpolation | |
# Works with Python 3.6 | |
i = 6 | |
j = 7 | |
print(f"{i*j} {i+j}") | |
print('\n'.join( | |
[ | |
f'{i}x{j}={i*j}' + ('\n' if j == 30 else "") | |
for i in range(2,21) for j in range(1,31) | |
] | |
) | |
) | |
harp = {":;": 4} | |
print(f"{harp[':;']}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment