def main():
            print (" PC : Hi there.whats your name?")
            userit = raw_input (" user :")
            print (" Pc : Nice to meet you " ) , userit ,
            userit = raw_input(" Do you like python? (A=Its Great, B=Its Ok, C=Its Rotten)")
        if userit == A:
            userit = userit.upper()
            print ("\n  Thats good. I like it too ") ,userit ,
        
        elif userit = B:
            userit = userit.upper()
            print ("\n  really what ever you say ") ,userit ,
        elif userit = C:
            userit = userit.upper()
            print ("\n  Thats bad ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit

            usergame = raw_input(" whats your rating in tennis? (A=best, B=better, C=better)")
        if usergame == A:
            usergame = userit.upper()
            print ("\n  wonderful i think you must compete federer ") ,userit ,
        elif usergame = B:
            usergame = userit.upper()
            print ("\n  good to play with me ") ,userit ,
        elif usergame = C:
            usergame = userit.upper()
            print ("\n  need more learn the game ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit

            userpl = raw_input(" which country do you like the most? (A=united states, B=Dubai, C=england)")
        if userpl == A:
            userpl = userit.upper()
            print ("\n  nice place to live ") ,userit ,
        elif userpl = B:
            userpl = userit.upper()
            print ("\n  Too expensive  ") ,userit ,
        elif userpl = C:
            userpl = userit.upper()
            print ("\n  good choice ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit

            userfood = raw_input(" what is your favorite food? (A=chinese, B=mexican, C=indian)")
        if userfood == A:
            userfood = userit.upper()
            print ("\n  hmmm thats mouth watering") ,userit ,
        elif userfood = B:
            userfood = userit.upper()
            print ("\n  you are into the right place  ") ,userit ,
        elif userfood = C:
            userfood = userit.upper()
            print ("\n  i think you are going to taste spicy curry  ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit
    
    
        
        
        
main()
         print ("\n  Please enter from the Above options ") ,userit

            usergame = raw_input(" whats your rating in tennis? (A=best, B=better, C=better)")
        if usergame == A:
            usergame = userit.upper()
            print ("\n  wonderful i think you must compete federer ") ,userit ,
        elif usergame = B:
            usergame = userit.upper()
            print ("\n  good to play with me ") ,userit ,
        elif usergame = C:
            usergame = userit.upper()
            print ("\n  need more learn the game ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit

            userpl = raw_input(" which country do you like the most? (A=united states, B=Dubai, C=england)")
        if userpl == A:
            userpl = userit.upper()
            print ("\n  nice place to live ") ,userit ,
        elif userpl = B:
            userpl = userit.upper()
            print ("\n  Too expensive  ") ,userit ,
        elif userpl = C:
            userpl = userit.upper()
            print ("\n  good choice ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit

            userfood = raw_input(" what is your favorite food? (A=chinese, B=mexican, C=indian)")
        if userfood == A:
            userfood = userit.upper()
            print ("\n  hmmm thats mouth watering") ,userit ,
        elif userfood = B:
            userfood = userit.upper()
            print ("\n  you are into the right place  ") ,userit ,
        elif userfood = C:
            userfood = userit.upper()
            print ("\n  i think you are going to taste spicy curry  ") ,userit ,
        else:
            print ("\n  Please enter from the Above options ") ,userit
    
    
        
        
        
main()

the error is indent error can somebody run this and sort me out thanks in advance

Recommended Answers

All 4 Replies

error msg
unindent does not match any outer indentation level

i dont understand

What that means is that the indentation level is not correct, this is best explained by examples:

if True:
    print "this"
  print "That"  ##Error!! The indentation is not standard

if True:
print "this"  ##Error!! No indentation

if True:
    print "This"
        print "That"#Error, indentation not correct.

if True:
    print "This" #works Fine!! Yay

All you have to do is clean up your indentation, if you are not using an IDE i would recommend starting, they really help with indentation! :)

I think this is what your code needs to look like

def main():
    print (" PC : Hi there.whats your name?")
    userit = raw_input (" user :")
    print (" Pc : Nice to meet you " ) , userit ,
    userit = raw_input(" Do you like python? (A=Its Great, B=Its Ok, C=Its Rotten)")
    if userit == A:
        userit = userit.upper()
        print ("\n Thats good. I like it too ") ,userit ,

    elif userit = B:
        userit = userit.upper()
        print ("\n really what ever you say ") ,userit ,
    elif userit = C:
        userit = userit.upper()
        print ("\n Thats bad ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit

    usergame = raw_input(" whats your rating in tennis? (A=best, B=better, C=better)")
    if usergame == A:
        usergame = userit.upper()
        print ("\n wonderful i think you must compete federer ") ,userit ,
    elif usergame = B:
        usergame = userit.upper()
        print ("\n good to play with me ") ,userit ,
    elif usergame = C:
        usergame = userit.upper()
        print ("\n need more learn the game ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit

    userpl = raw_input(" which country do you like the most? (A=united states, B=Dubai, C=england)")
    if userpl == A:
        userpl = userit.upper()
        print ("\n nice place to live ") ,userit ,
    elif userpl = B:
        userpl = userit.upper()
        print ("\n Too expensive ") ,userit ,
    elif userpl = C:
        userpl = userit.upper()
        print ("\n good choice ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit

    userfood = raw_input(" what is your favorite food? (A=chinese, B=mexican, C=indian)")
    if userfood == A:
        userfood = userit.upper()
        print ("\n hmmm thats mouth watering") ,userit ,
    elif userfood = B:
        userfood = userit.upper()
        print ("\n you are into the right place ") ,userit ,
    elif userfood = C:
        userfood = userit.upper()
        print ("\n i think you are going to taste spicy curry ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit







    usergame = raw_input(" whats your rating in tennis? (A=best, B=better, C=better)")
    if usergame == A:
        usergame = userit.upper()
        print ("\n wonderful i think you must compete federer ") ,userit ,
    elif usergame = B:
        usergame = userit.upper()
        print ("\n good to play with me ") ,userit ,
    elif usergame = C:
        usergame = userit.upper()
        print ("\n need more learn the game ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit

    userpl = raw_input(" which country do you like the most? (A=united states, B=Dubai, C=england)")
    if userpl == A:
        userpl = userit.upper()
        print ("\n nice place to live ") ,userit ,
    elif userpl = B:
        userpl = userit.upper()
        print ("\n Too expensive ") ,userit ,
    elif userpl = C:
        userpl = userit.upper()
        print ("\n good choice ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit

    userfood = raw_input(" what is your favorite food? (A=chinese, B=mexican, C=indian)")
    if userfood == A:
        userfood = userit.upper()
        print ("\n hmmm thats mouth watering") ,userit ,
    elif userfood = B:
        userfood = userit.upper()
        print ("\n you are into the right place ") ,userit ,
    elif userfood = C:
        userfood = userit.upper()
        print ("\n i think you are going to taste spicy curry ") ,userit ,
    else:
        print ("\n Please enter from the Above options ") ,userit





main()

Looks to me that the code started with tabs and the usual 4 spaces mixed in, and then the tabs were converted to 8 spaces. Whatever you do, don't mix tabs and spaces! For your own sanity avoid tabs!

Uniform indentations for the code blocks are critical with Python.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.