Loading...
  1. Dismiss Notice
  2. Dismiss Notice
  3. Dismiss Notice
  4. Dismiss Notice
  5. If this is your first visit, you may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

(Brain Killer) Anyone know Python and can figure this out >.<

Discussion in 'Programming Lounge' started by Fluffaluffagus, Oct 4, 2015.

Thread Status:
Not open for further replies.
  1. Fluffaluffagus

    Fluffaluffagus Meow

    Joined:
    Dec 25, 2011
    Messages:
    525
    Likes Received:
    297
    Trophy Points:
    328
    Location:
    NYC
    Ok got an Assignment and these are the instructions:

    Assign True or False as appropriate for bool_one through bool_five.

    1. Set bool_one equal to the result ofFalse or not True and True
    2. Set bool_two equal to the result ofFalse and not True or True
    3. Set bool_three equal to the result of True and not (False or False)
    4. Set bool_four equal to the result ofnot not True or False and not True
    5. Set bool_five equal to the result ofFalse or not (True and True)
    Here is the Code line:

    Code:
    bool_one =
    
    bool_two =
    
    bool_three =
    
    bool_four =
    
    bool_five =
    
    The Hint:
    Hint
    1. True or not False and False.not gets evaluated first, so we have
    2. True or True and False. andgoes next, so we get
    3. True or False. As we've seen,True or False is True, so the value finally returned is True!
     
  2. Georgie

    Georgie Ḏɪ̭̜͓̜ͅs̪ᴛ̩̪͓ᴜ̬̖̗̬ʀ̻͚̖͎ʙ͉̜͓̖͙̼͖̳ᴇ̖̞̻ᴅ̻̞̫̘̫ͅ Forum Legend

    Joined:
    May 28, 2010
    Messages:
    2,458
    Likes Received:
    1,548
    Trophy Points:
    398
    12027770_1048522901847571_5983246420543805260_n.jpg 12063691_1048522908514237_1265664203499400552_n.jpg
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
  3. BetaMax

    BetaMax Lord Emperor Forum Legend

    Joined:
    Sep 22, 2010
    Messages:
    4,920
    Likes Received:
    2,341
    Trophy Points:
    458
    Location:
    Illinois
    Trulse.........
     
  4. Fluffaluffagus

    Fluffaluffagus Meow

    Joined:
    Dec 25, 2011
    Messages:
    525
    Likes Received:
    297
    Trophy Points:
    328
    Location:
    NYC
  5. Fluffaluffagus

    Fluffaluffagus Meow

    Joined:
    Dec 25, 2011
    Messages:
    525
    Likes Received:
    297
    Trophy Points:
    328
    Location:
    NYC
    Answer:

    Code:
    bool_one = 4 == 5 or 4 == 5 and 2 == 2
    
    bool_two = 4 == 5 or 4 == 4
    
    bool_three = 4 == 4 or 4 == 5
    
    bool_four = 4 == 4 
    
    bool_five = 4 == 5 or 4 == 5 and 2 == 2
     
     
Thread Status:
Not open for further replies.

Share This Page