Question

Python Activity 05 Boolean Expressions - POGIL (5) - Word Search m Layout References Mailings Review View Help Critical Think
VICW Rep 4. What is the result of each of the following expressions? Assume: x = 4, y = 5, and z = 4 ow a. >y b. x<y c.xy - X
Python Activity 05 Boolean Expressions - POGIL (5) - Word Search Design Layout Review View Help References Mailings g. x+y> 2
Layout Relerence Mailings Review View Help 9. Assume the value of the variable numBooks is 40. State the values of each of th
a Boolean expression that tests if the value stored in the variable time is less than the value stored in the variable maxTim
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.sequence

2. decision or branching because decide for execute which part of code based on some conditions.

3.

>>> 24 <25
True
>>> 85>25
True
>>> 23<=63
True
>>> 54>=25
True
>>> 5!=5
False
>>> 6==6
True

Python 3.8 (64-bit) Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) Type help, copyright, credits or license

4.

>>> x=4
>>> y=5
>>> z=4
>>> x>y
False
>>> x<y
True
>>> x==y
False

>>> x!=y
True
>>> x>=z
True
>>> x<=z
True
>>> x+y>2*x
True
>>> y*x-z!=4%4+16
False
>>> pow(x,2)==abs(-16)
True

>>> X=4 >>> y=5 >>> Z=4 >>>> x>y False >>> x<y True >> X==y False>>> x!=y True >>> XX=Z True >>> X<=Z True >>> x+y>2*X True >>> y*x-z!=4%4+16 False >>> pow(x,2)==abs(-16) True

5.

>>> word1="hello"
>>> word2="good-bye"
>>> word1==word2
False
>>> word1!=word2
True
>>> word1<word2
False
>>> word1>=word2
True

>>> word1=hello >>> word2=good-bye >>> word1==word2 False >>> word1!=word2 True >>> word1<word2 False >>> word1>=word2 Tr

6. Python compares string lexicographically i.e using ASCII value of the characters.

Suppose you have word1 as "hello" and word2 as "good-Bye". The first two characters from str1 and str2 ( H and G ) are compared. As they are not equal h greater than g.

8. Logical operator are and,not,or

age>=17 and hasLicence==true , The and operator return true onle when both operands are true. Here if age>=17 true and hasLicence==true is true then the result will be true other wise return false.

cost<20 or shipping==0.00 , or operator return true either one of the opernad is true. if cost<20 return true the output will true. if shipping ==0.00 the output will be true.

not(credit>120) not opertor invert the operand. Here credit>120 is true the output will be false.

9.>>> (numBooks>5) and (numBooks<100)
True
>>> (numBooks<5) or (numBooks>100)
False
>>> not(numBooks*10==100)
True

>>> (numBooks>5) and (numBooks<100) True >>> (numBooks<5) or (numBooks >100) False >>> not (numBooks*10==100) True

Application questions

1.

>>> num1=10
>>> num2=10
>>> num1==num2
True

>>> num1=10 >>> num2=10 >>> num1==num2 True

2.

>>> time=5
>>> maxTime=10
>>> cost=10
>>> maxCost=100
>>> (time<maxTime) or (cost<maxCost)
True
>>> time=5 >>> maxTime=10 >>> cost=10 >>> maxCost=100 >>> (time<maxTime) or (cost<maxCost) True >>>

3.

>>> weight=50
>>> cost=100
>>> (weight<10) and (not(cost>20))
False

>>> weight=50 >>> cost=100 >>> (weight<10) and (not(cost>20)) False >>>

If the code helpful to you please give thumbs up.


Add a comment
Know the answer?
Add Answer to:
Python Activity 05 Boolean Expressions - POGIL (5) - Word Search m Layout References Mailings Review...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Word Bank: a) python b) computer science c) algorithm d) program e) interpreter f) compiler g)...

    Word Bank: a) python b) computer science c) algorithm d) program e) interpreter f) compiler g) syntax h) semantics i) value J) variable k) operator l) operand m) expression n) statement o) input p)output q)call r) arguments s) library t) bug u) variable scope v) local variable w)global variable x) variable lifetime y) relational operators z) logical operators 1) Compares operands and results in a bool: 2) The duration of a variable's existence: 3) A list of instructions to solve...

  • Document1 - Word Search Layout References Mailings Review View Help BUS-522 Fundamentals of Healthcare Finance Homework...

    Document1 - Word Search Layout References Mailings Review View Help BUS-522 Fundamentals of Healthcare Finance Homework Week 5 Susan G. Midgett, BSN, RN, CNOR 8.5 Morningside Nursing Home, a not-for-profit corporation, is estimating its corporate cost of capital. Its tax-exempt debt currently requires an interest rate of 6.2 percent, and its target capital structure calls for 60 percent debt financing and 40 percent equity (fund capital) financing. Its estimated cost of equity is 15.4 percent. What is Morningside's corporate cost...

  • om me insert e Search - Assignment - Word Design Layout References Mailings Review Lucida Sans...

    om me insert e Search - Assignment - Word Design Layout References Mailings Review Lucida Sans Typ 11 - A A A A - BIU XX A.D.A. View ру mat Painter rd CIT 111 Help! 21 - - 19. ABCD AaBbcDc AaB 1 Normal TNo Spac... Head Paragraph PROGRAMS SPRING 2020 8.3 points Write a method that determines if a positive integer is an abundant number. A number is abundanti the sum of its proper divisors (a divisor that isn't...

  • 1430-251 Practice Exam 1 Word Layout References Mailings Review view Help ink to Shape ink to...

    1430-251 Practice Exam 1 Word Layout References Mailings Review view Help ink to Shape ink to Math 20 points) Imagine you are looking down on an object from above. The object is initially moving parallel to the x-axis with a speed of 13 . Att = 0, it is subject to an acceleration of magnitude 3.7 directed at an angle of 23 above the positive x-axis. Show your work and be sure to include units for all parts of the...

  • QUESTION 2 Boolean or "truth-valued" expressions are how we express conditions that control choices and repetition...

    QUESTION 2 Boolean or "truth-valued" expressions are how we express conditions that control choices and repetition in computer languages. Consider the following Python Boolean expression, where variables alpha, beta, and gamma are of type Boolean: alpha and (beta or gamma) In any algebraic notation there are usually several different ways of writing the same expression. For instance, in integer arithmetic the value of expression '4 x (5 + 2)' is numerically equivalent to that of expression '(4 x 5) +...

  • Document1 - Word AutoSave on ile Home S Insert Review ViewHelp 2-0- Design Layout References Mailings...

    Document1 - Word AutoSave on ile Home S Insert Review ViewHelp 2-0- Design Layout References Mailings Calibr (Body) - 11 A A A A BIU.. * * A..A. Comments Ах аа E B E. 21 . Search al AaBbca AaBb Dd AaBb AaBbcc AaB AalbcDAoBbcod Aabcbd. 1 Normal No Spac. Heading 1 Heading 2 Title Subtitle Subtle Em... Emphasis Styles 1. Share find Belace Select Editing - . Dictate Format Painter Clipboard Font Paragraph Consider three bonds with maturities of...

  • = 1-Lab from Chapter 15 Eq and Le Chat - Word Search Design Layout References Mailings...

    = 1-Lab from Chapter 15 Eq and Le Chat - Word Search Design Layout References Mailings Review View Help Add i nk Ink to Ink to Drawing Ink Pen Editor Shape Math C anvas Replay Convert Replay Open the Le Chatlier's Principle Activity found in your textbook, Interactive General Chemistry. (Section 15.6, Figure 15.9), run the simulation and complete the following questions. Pens insert 1. Start with the default settings where K - 1.00. a. Write the expression based on...

  • Tasha Crews TC ab o s Documenti - Word Search Insert Draw Design Layout References Mailings...

    Tasha Crews TC ab o s Documenti - Word Search Insert Draw Design Layout References Mailings Review View Help A A A E 21 AaBbCcDc AaBbCcDc AaBb C AaBbccc Add Uab x x ADA 19 - 1 Normal 1 No Spac... Heading 1 Heading 2 Title Find Replace Select Dictate Voice Styles Editing 1. Use the above information to prepare a statement of cash flows for the current year using the Indirect method (Amounts to be deducted should be indicated...

  • W2015 File Home Documenti - Microsoft Word Add-Ins Insert Page Layout References Mailings Review View %...

    W2015 File Home Documenti - Microsoft Word Add-Ins Insert Page Layout References Mailings Review View % Cut E Copy Paste Format Painter Clipboard Calibri (Body] - 11 A A Aa Ley 5 BI Uzbe X* Aaby- A E Font E 21 15 23 Paragraph AaBbCcDc AaBbCcDc AaBb C AaBb Cc AaB AaBb Cc AaBb CDI 1 Normal 1 No Spac... Heading 1 Heading 2 Title Subtitle Subtle Em.. Styles Change Styles Find 4ac Replace As Select Editing Suppose the mean...

  • Number 14 please 3503 FA18 HW 2- Word Insert Design Layout References Mailings Review View Tell...

    Number 14 please 3503 FA18 HW 2- Word Insert Design Layout References Mailings Review View Tell me Kevin P... Sha File Home Arial Paste Paragraph Styles Account #1 pays simpie interest at rne rate or o.uro per year compounaea an nually or four years. How much could you withdraw at the end of year 4 from Account #1? a) b) How much could you withdraw at the end of year 4 from Account #27 c) Which account will you select?...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT