Python Forum
Problem with a basic if challenge
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with a basic if challenge
#1
Hey guys , I have been programming to complete this basic challenge and I'm facing an error . i don't know what i have to do in this . I'm thankful if you could help me .
This is my programme :

name = input("Please enter your name: ")
age = int(input("Please enter your age: ")
if (age >= 18) and (age <= 31):
	print( 'Welcome to our party{0}'.format( name ) )
else:
	print("We apologize you , you do not have the permission to enter this party because of your __AGE__")
Then i got this error massage :
if (age >= 18) and (age <= 31):
^
SyntaxError: invalid syntax

What should i do ?
Reply
#2
Hello, the error message is pointing at a slightly "unfortunate" position, but you are mising a right parenthesis on line 2.
Reply
#3
(Oct-11-2018, 05:48 PM)j.crater Wrote: Hello, the error message is pointing at a slightly "unfortunate" position, but you are mising a right parenthesis on line 2.
Wow , thanks that was right Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Team Chooser Challenge kanchiongspider 3 2,315 Jun-02-2020, 04:02 AM
Last Post: kanchiongspider
  Meal cost challenge Emekadavid 3 2,802 Jun-01-2020, 02:01 PM
Last Post: Emekadavid
  Appending To Files Challenge erfanakbari1 3 2,867 Mar-27-2019, 07:55 AM
Last Post: perfringo
  trying an online challenge tozqo 8 5,877 Jun-21-2017, 07:07 AM
Last Post: Kebap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020