String Formatting


#1

https://www.codecademy.com/courses/learn-python/lessons/strings--console-output/exercises/string-formatting-with--part-?action=resume_content_item

i had tried this code in python 3 IDLE with parenthesis knowing that it is a function now
but it haven’t worked . Please help!


#2

if we can’t see the code you attempted in the IDLE, its really difficult to tell why it isn’t working


#3

Ok here is the screenshot


#4

Hello :slight_smile:

string_1 = "Camelot"
string_2 = "place"

print("Let's not go to %s. Tis a silly %s." % (string_1, string_2))

Tuple with the strings you want to put in must be a part of the function call.

You have closed the call to the function print too early ()).


#5

Oh so everything should be inside the parenthesis of the function 'print’
Now i have understand thanks! :slight_smile:


#6

Exactly! You’re welcome :slight_smile:


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.