Problem
Here he understands that all content is one string
complete, since you start with single quotes and end with single quotes, and he understands double quotes as part of the string, since you start the instruction with single quotes.
print(f'Seu nome possui {len(nome.replace(" ", ""))} letras')
Here the situation is different, he interprets the instruction as if it were passed 3 strings
different separated with space, since you started with simple quotes, it waits for the end with simple quotes.
print(f'Seu nome possui {len(nome.replace(' ', ''))} letras')
How the strings got separated
String 1: 'Its name has {Len(name.replace('
String 2: ', '
String 3: '))} letters'
An example
I’ll give a simpler example to see the problem
It’s like you want to do the print
as follows:
print('oi' 'eu' 'sou' 'assim')
And the right thing would be
print('oi eu sou assim')