These are getting complex, is there an easy way to solve them?


#1

Question

These are getting complex, is there an easy way to solve them?

Answer

It may not necessarily be an easy way, but some exercises that have always helped me and many others are described below, and work for any issue you come across on your programming journeys!

  • The rubber ducky method! You literally talk out loud to a rubber ducky, or anything else, or nothing at all like a crazy coder, and this act of talking out loud lets you hear your mistakes! It often helps to hear them verbally instead of in your head.
  • Good ol’ pen and paper! You’d be surprised how often a problem you’re having can be solved if you write it out step by step. Keeping each step of a problem correctly in your head is a difficult task, and becomes nearly impossible as you progress and do more difficult work.
  • With either method, always break down the problem into its simplest parts.

FAQ: Learn Python - Conditionals & Control Flow - This and That (or This, But Not That!)
#2

2 posts were split to a new topic: Need Help Understanding Boolean Expressions


#3

I feel like I am just copying and pasting. What am I supposed to be learning?


#4

I felt the same way at first because i was just copying and pasting lol but for instance this is the way I broke it down after i looked at it better here is an example
and I will break down the first question here

Set bool_one equal to the result of
False or not True and True
You start with not. Not of True is False so your left with False or False and True after that you move to and False and True is False. so you are left with False or False. False or False is False so you have the answer of false

#And Flase or True not not
# not,and,or

#False or not True and True
#False false false

##Question False or not True and True
## You start with not. Not of True is False so your left with False or False and True after that you move to and False and True is False. so you are left with False or False. False or False is False so you have the answer of false
bool_one = False
#False and not True or True
#False false True
bool_two = True
#True and not (False or False
#False False
bool_three =  True
#not not True or False and not True
#True or False and False
bool_four = True
#False or not True and True
bool_five = False



#5

Why is False and True False?


#6

because and requires both conditions to be true. Only if both conditions are met, evaluate to true

this can be very handy for example for a login functionality. Only if the password and username match, log the user in. You don’t want to login the user if only the password or the user name is correct


#7

The good ole pen and paper method works well for me,haha


#8

You may need take a look this logic gates.