user13373385
user13373385

Reputation: 21

why do i get a syntax error when print tuple?

Im getting invalid syntax when I try to print the tuple zipped

print (zipped)
    ^

SyntaxError: invalid syntax

x = (3,6,7,4,0)
y = (2,6,7,4,1)

zipped = zip(tuple((x,y))

print (zipped)

Upvotes: 2

Views: 301

Answers (1)

some_programmer
some_programmer

Reputation: 3578

As pointed out by A.J. Uppal in the comments, you were missing a ) in the zipped statement

x = (3,6,7,4,0)
y = (2,6,7,4,1)

zipped = zip(tuple((x,y)))

print (zipped)

# output
<zip object at 0x7f3f1c91c480>

Upvotes: 1

Related Questions