Using Methods in Python
The code print('The first participant is ' +Participants[0]+'.')is not working very well .. it show an error
2 answers ( 0 marked as helpful)
Hi Muhammad!
Thanks for reaching out!
Could you please support your question with a screenshot containing the entire error message you’ve encountered? This can help us assist you better. Thank you.
Looking forward to your answer.
Best,
Tsvetelin
Hey Faisal,
Please convert the "numbers" to string first, then you can concatenate it with the other strings. Use the following code,
print('The first participant is ' +str(Participants[0])+'.')