0

I'm new to python and currtly playing a little bit with it.

So I'm trying to use string formatting and get an error message for following code:

domain = 'myway.net'
inet = 'the internet'

line2 = "Play the way through %s using %s" (inet, domain)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'str' object is not callable

What doing I wrong?

1 Answer 1

3

Perhaps you're missing the format operator in between the string and the arguments? Try adding % in between:

line2 = "Play the way through %s using %s" % (inet, domain)
Sign up to request clarification or add additional context in comments.

1 Comment

Thx a lot! Did not see that.. :-X

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.