|
Post by Marco Kurvers on Dec 2, 2023 13:43:18 GMT
Python is an easy program to coding data structures and string formats. You can use tuples, sets, lists and dictionary's. The print() function has many useful formats for nice printing text and expression results. With the {} symbols, you can place expressions without to split this with a comma.
For formats in a print() function, there are two possibilities:
print('The sum is {}'. format(20+20))
or
print(f'The sum is: {20 + 20}')
An another same result is the older method:
print('The sum is ', 20 + 20)
The result is: The sum is 40
You see that the function prints one extra space.
|
|