Hi, New to coding and cant seem to find the solution for this error (Python)
Question:
Answers:
It appears you are trying to print the contents of the list after the hardcoded string. So your code is first printing "hello and" and then the string representation of the list ‘text’. In order to print the elements of the list using an f string you can do:
text = ['this','is','text']
print(f"hello and {' '.join(text)}")
It appears you are trying to print the contents of the list after the hardcoded string. So your code is first printing "hello and" and then the string representation of the list ‘text’. In order to print the elements of the list using an f string you can do:
text = ['this','is','text']
print(f"hello and {' '.join(text)}")