I have a problem here.
I don't know why this code does not work.
newline = '\n'
tasks_choosen = ['markup', 'media', 'python_api', 'script', 'style', 'vue']
print(f'{ newline }### Initializing project with the following tasks: { ' '.join(tasks_choosen) }.{ newline }')
Error:
File "new-gulp-project.py", line 85
print(f'{ newline }### Initializing project with the following tasks: { ' '.join(tasks_choosen) }.{ newline }')
SyntaxError: f-string: expecting '}'
Can anyone help me?
Thanks
Because you use single quotes twice you get:
print(f'{ newline }### Initializing project with the following tasks: { '
instead of
print(f'{ newline }### Initializing project with the following tasks: { ' '.join(tasks_choosen) }.{ newline }')
Use double quotes inside:
print(f'{ newline }### Initializing project with the following tasks: { " ".join(tasks_choosen) }.{ newline }')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With