M_Ouz
M_Ouz

Reputation: 25

Invalid Syntax Error On Python3 About print

def Corner(n):
  if n == 3:
    print('İts An Triangle \nBu Bir Üçgen')
  elif n == 4:
    print('İts An Rectangle or Square or Parrallelogram \nBu Bir 
   Dikdörtgen yada Kare yada ParalelKenar ')
  elif n == 5:
    print('İts An Pentagon \nBu Bir Beşgen')
  elif n == 6:
    print('İts An Hexagon \nBu Bir Altıgen')
  else:
    print('Bir Köşe Sayısı Girmediniz \nYou Didnt Wrote a Corner 
 Number '

print Corner(6)

**File "Köşegen.py", line 13
print Corner(6)
    ^
SyntaxError: invalid syntax**

Its The Error Code I wrote it on Python3 This Code About the Corners and Shapes but I had that massage when I run the code

Upvotes: 0

Views: 301

Answers (3)

M_Ouz
M_Ouz

Reputation: 25

I'm Closed The Parantheses and Its Worked Thanks For Help Artemis Fowl and Todd W

def Corner(n):
  if n == 3:
    print('İts An Triangle \nBu Bir Üçgen')
  elif n == 4:
    print('İts An Rectangle or Square or Parrallelogram \nBu Bir 
   Dikdörtgen yada Kare yada ParalelKenar')
  elif n == 5:
    print('İts An Pentagon \nBu Bir Beşgen')
  elif n == 6:
    print('İts An Hexagon \nBu Bir Altıgen')
  else:
   print('Bir Köşe Sayısı Girmediniz \nYou Didnt Wrote a Corner Number')

print(Corner(6))

Upvotes: 0

Miriam
Miriam

Reputation: 2711

In python 3, print is a function just like any other, so you need parentheses, as below:

print(' something ') 

Rather than:

print ' something '

In python 2

Upvotes: 0

Todd W
Todd W

Reputation: 397

You're missing some parentheses:

print('Bir Köşe Sayısı Girmediniz \nYou Didnt Wrote a Corner Number ') # here

print(Corner(6)) # and here

Upvotes: 2

Related Questions