SyntaxError: closing parenthesis '}' does not match opening parenthesis '('

SyntaxError: closing parenthesis ‘}’ does not match opening parenthesis ‘(‘

In python SyntaxError: closing parenthesis ‘}’ does not match opening parenthesis ‘(‘ we face this error message when we use or add a closing curly bracket “ } ” instead of closing round bracket “ ) “ then the python interpreter shows this error message If you want to fix this error you need to just add use closing round bracket “ ) “ with a correct symbol like “print{ )” to print(), For more clarification see the below example.

Wrong Code

print("Welcome To Amol Blog Leap Year Python Code"}
year = int(input("Enter Year:"))

if year % 4 == 0:
    if year % 100 == 0:
        if year % 400 == 0:
            print(f"{year} Is Leap Year")
        else:
            print(f"{year} Is Not Leap Year")
    else:
        print(f"{year} Is Not Leap Year")
else:
    print(f"{year} Is Not Leap Year.")

Error Massage

  File "/home/kali/python/webproject/simple_projects/Leap_year/main.py", line 1
    print("Welcome To Amol Blog Leap Year Python Code"}
                                                      ^
SyntaxError: closing parenthesis '}' does not match opening parenthesis '('

Wrong code line

print("Welcome To Amol Blog Leap Year Python Code"}

Correct code line

print("Welcome To Amol Blog Leap Year Python Code")
  • Wrong action: “print( }”.
  • Correct action: “print()”.

Entire Correct Code line

print("Welcome To Amol Blog Leap Year Python Code")
year = int(input("Enter Year:"))

if year % 4 == 0:
    if year % 100 == 0:
        if year % 400 == 0:
            print(f"{year} Is Leap Year")
        else:
            print(f"{year} Is Not Leap Year")
    else:
        print(f"{year} Is Not Leap Year")
else:
    print(f"{year} Is Not Leap Year.")

What is SyntaxError: closing parenthesis ‘}’ does not match opening parenthesis ‘(‘?

In python we face this error message when we use or add a closing curly bracket “ } ” instead of closing round bracket “ ) “ then the python interpreter shows this error message.

How to fix SyntaxError: closing parenthesis ‘}’ does not match opening parenthesis ‘(‘?

To fix this error you need to just add and use the closing round bracket “ ) “ with a correct symbol like “print{ )” to print(), For more clarification see the above example.

For more information Visit YouTube Channel.

Scroll to Top
Mother’s Day Python Code Love calculator Miss Universe And You Check Your Love Score With K-POP Idols Check Your Love Score With Childhood Crush