fstring, can anyone help in debugging, the output is not apt | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

fstring, can anyone help in debugging, the output is not apt

name = print(input("enter then name:")) statement = f"{name}is great" print(statement) output should be "name is great" but a "none is added in between in the output

1st Jan 2022, 7:31 AM
Debashish Das
Debashish Das - avatar
2 Answers
+ 10
You need to remove the print statement in the first line name = input("enter then name:")
1st Jan 2022, 7:35 AM
Simba
Simba - avatar
+ 6
Debashish Das , if you like, the output can be slightly optimized: - we can use f-string directly inside the print() function - we should have a space between the name and the word *is* print(f"{name} is great")
1st Jan 2022, 10:04 AM
Lothar
Lothar - avatar