Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
is "True or True and False" the same as "(True or True) and False" which is False or "True or (True and False)" which is True? here, the quotes i type mean general code
 one year ago
 one year ago
is "True or True and False" the same as "(True or True) and False" which is False or "True or (True and False)" which is True? here, the quotes i type mean general code
 one year ago
 one year ago

This Question is Open

msmithhnovaBest ResponseYou've already chosen the best response.0
You could type it into the Python shell and it would tell you ... But by order of operations AND is processed before OR without brackets. See this link http://www.informit.com/articles/article.aspx?p=459269&seqNum=11
 one year ago

PatapomBest ResponseYou've already chosen the best response.0
Without parentheses to clarify, this would evaluate as "True or (True and False)" = True. "and" evaluating first... (as far as I know in C, C++, C#, JS and Java)
 one year ago

KonradZuseBest ResponseYou've already chosen the best response.1
I don't think it checks && or  first, I believe it goes based on what is read first. Make a Truth Table and see how it goes.
 one year ago

msmithhnovaBest ResponseYou've already chosen the best response.0
Idle output below, as you can see in both cases with "and" before "or" or "and" after "or" it is equivalent to putting brackets around the "and" part meaning it is processed first. >>> True or True and False True >>> True or (True and False) True >>> (True or True) and False False >>> False and False or True True >>> (False and False) or True True >>> False and (False or True) False
 one year ago

KonradZuseBest ResponseYou've already chosen the best response.1
The thingj is, he said he's using "General code." I think this is more of an example of Digital Electronics. ANDS, NOTS, ORS, NORS, XOR, etc. The thing is what are the variables? What is true, and what is false? 1 variable? 2?
 one year ago

ArunS07Best ResponseYou've already chosen the best response.1
without parentheses, the precedence can be judged with 'NAO' (not , and , or)
 one year ago

amine2206Best ResponseYou've already chosen the best response.0
in any programming language there is precedence of operators (which one must be evaluated at first) , so just check the precedence and you'll get your answer :)
 one year ago
See more questions >>>
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.