How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask George Sibiya Your Own Question
George Sibiya
George Sibiya, Computer Hardware Engineer
Category: Programming
Satisfied Customers: 220
Experience:  PhD in Computer Science
94470076
Type Your Programming Question Here...
George Sibiya is online now
A new question is answered every 9 seconds

Def main(): #Ask the user for number of pocket

This answer was rated:

def main():#Ask the user for number of pocket
number_of_pocket = int(input("Enter a pocket number: "))#Determine the color
if number_of_pocket == 0:
print ("green")
else:
number_of_pocket >= 1 and number_of_pocket <= 10
if number_of_pocket % 2 :
print("Pocket", number_of_pocket, "is red")
else:
print("Pocket", number_of_pocket, "is black")
else:
number_of_pocket >= 11 and number_of_pocket <= 18
if number_of_pocket % 2:
print("Pocket", number_of_pocket, "is black")
else:
print("Pocket", number_of_pocket, "is red")
else:
number_of_pocket >= 19 and number_of_pocket <= 28
if number_of_pocket % 2:
print("Pocket", number_of_pocket, "is red")
else:
print("Pocket", number_of_pocket, "is black")
else:
number_of_pocket >= 29 and number_of_pocket <= 36
if number_of_pocket % 2:
print("Pocket", number_of_pocket, "is black")
else:
print("Pocket", number_of_pocket, "is red")
else:
print("That is not a vaild pocket number")
JA: What programs and versions are you using?
Customer: I'm using cs50.io I keep getting syntax error and I cant fix it
JA: What is your ideal outcome? How can we solve this for you?
Customer: I need someone to check what the error is for me
JA: Anything else you want the programmer to know before I connect you?
Customer: no that would be it for now

Hi,

Welcome to JustAnswer and thank you for utilising our services.

I'll help debug it and post back shortly

Regards,

G

This one should work just fine

George Sibiya and other Programming Specialists are ready to help you