f-strings example with capital letter F

pull/30675/head
Therk 2018-10-27 18:05:31 -04:00
parent e55dd116d2
commit 8f498480ce
1 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,25 @@ print(greeting)
Hello! Jon Snow
```
### Will also work with capital letter F:
#### Input
```python
author = 'George R. R. Martin'
title = 'A Game of Thrones'
book = F"'{book}' by {author}"
print(book)
```
#### Output
```
'A Game of Thrones' by George R. R. Martin
```
### Evaluate an expression in a string:
#### Input