mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2026-01-28 22:28:02 -08:00
added shortcuts to send current session to the background and get them back
added what is 'f-string' and one example
This commit is contained in:
@@ -380,3 +380,14 @@ function_name()
|
||||
* We need not to specify the return type of the function.
|
||||
* Functions by default return `None`
|
||||
* We can return any datatype.
|
||||
### f strings
|
||||
* Short of "formatted string".
|
||||
* Allow us to to embed expressions inside string literals.
|
||||
* f-strings are denoted by "f" or "F" prefix before the string
|
||||
* Expressions are closed by curly braces '{}' with the f-string
|
||||
```
|
||||
name = "Alice"
|
||||
print(f"Hello, I am {name} and I am a programmer.")
|
||||
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user