BIG IF....Giving Big troubles


#1

So right now, I am on Big If and trying of hours but cant figure it out. If you can give me a code that works...It will be really appreciated....Plz Help


#2

You will have to show us your code. :smile:


#3

@legend1400 What is the point of us giving you the code... You came here to be a better programmer and maybe in the future work in a programming field, not for us to give you code. Common paste your code and we will resolve your errors. Thankyou


#4

Make sure that the_flying_circus() returns True

def what_is_your_name?():
decision = raw_input("Whats your name")

    if decision == "Deep":    
        print "Welcome"
    else:
        print "Invalid User ID"

Heres my code


#5

and thanks for your concern, but i am not going in programming field... I am doing this as I am in GenYes and this our project to complete 1 program of coding


#6

Hey @legend1400,

Make sure you follow the instructions... :sweat:

MAKE SURE THAT THE_FLYING_CIRCUS() RETURNS TRUE is what it says, right?

Your function is supposed to be the_flying_circus, then, not what_is_your_name?.

Now, it seems as if you have to make it true, whatever the answer is. So is there supposed to be a raw_input? In the instructions, if there are no words describing anything like, I suggest not adding it.

Then you can do:

if 16 == 16:
return True
else:
return False

Okay, I have looked at the instructions, and it seems that you have not read them:

Write an if statement in the_flying_circus(). It must include:

  1. if, elif, and else statements;
  2. At least one of and, or, or not;
  3. A comparator (==, !=, <, <=, >, or >=);
  4. Finally, the_flying_circus() must return True when evaluated.

Please follow the instructions exactly. Thanks!:smile:


#7

Thanks for the help...I was trying to make my own code using the instruction as an example.


#8

Can someone help me with this code? What am I doing wrong? My original code didn't work so I tried to use the advice already given but I still haven't gotten anything.


#9

Your code is good, you have a typo in the "Print the_flying_circus()", make Print in print and it will work! aswell your Return in return.
Let me know if you need any help!
PS: In your else statement put return False instead of True


#10

Nice topic name.. :laughing:


#11

i came here looking for examples too..as i dont pick things up so quick in python programming...disregard the those replies


#14

Hi Everyone! Can someone please check my code to this one? I'm told that I need to include at least one boolean operator, but I already have, haven't I in line 4?

Make sure that the_flying_circus() returns True

def the_flying_circus():
if 5 == 5: # Start coding here!
return true
elif the_flying_bircus():
print "Not Flying Circus"
else:
print "false"


#15

Hi jp1057,
What boolean operator do you think you used in line 4? I think boolean operators are like [and or nor not]

You may have a typo in line 4, e.g. "bircus" should be "circus"


#16

Would anyone of you be so kind in telling what am I doing wrong? Thanks a lot!

def the_flying_circus():
if True and True == False:
print "Not going to print"

elif 2389674 + 1 <= 329804738294:
    print "This should print."

else:
    print "Not going to print"

#17

I´ve found a working code in another thread:
def the_flying_circus():
if "Alpha" and "Bravo" == 2:
return "1st line is true!"
elif 1 > 2:
return "2nd line is true!"
else:
return True

I really don´t understand a piece of this. Besides, the RETURN was never used before... PRINT always worked :neutral_face:

Anyway, I think I should do the chapter again


#18

Hey gonzaloquintas! I think RETURN is for internal operation, while PRINT determine what we will see in the sub-screen on the left. That means return is a part of conditional statement syntax.


#19

Thanks Beckley, I appreciate the follow-up. Regarding the Bircus vs. Circus, that was intentional, just to provide two different functions. Regarding the boolean operator, I see that what I thought was incorrect. Thanks. I'm working on this :slight_smile:


#23

A post was split to a new topic: Problem is "now" is not defined


#24