Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is for my computer science class, where we are learning about python. 2.17 Write Boolean expressions corresponding to the following logical statements and evaluate
This is for my computer science class, where we are learning about python.
2.17 Write Boolean expressions corresponding to the following logical statements and evaluate the expressions: (a) The sum of 17 and -9 is less than 10. (b) The length of list inventory is more than five times the length of string fullname. (c) c is no more than 24. (d) 6.75 is between the values of integers a and b. (e) The length of string middle is larger than the length of string first and smaller than the length string last. (1) Either the list inventory is empty or it has more than 10 objects in it. 2.18 Write Python statements corresponding to the following: (a) Assign to variable flowers a list containing strings 'rose', 'bougainvillea', 'yucca', 'marigold', 'daylilly', and 'lilly of the valley'. (b) Write a Boolean expression that evaluates to True if string 'potato' is in list flowers, and evaluate the expression. (c) Assign to list thorny the sublist of list flowers consisting of the first three objects in the list. (d) Assign to list poisonous the sublist of list flowers consisting of just the last object of list flowers. (0) Assign to list dangerous the concatenation of lists thorny and poisonous. 2.19 A dartboard of radius 10 and the wall it is hanging on are represented using the two dimensional coordinate system, with the board's center at coordinate (0,0). Variables x and y store the x- and y coordinate of a dart hit. Write an expression using variables x and y that evaluates to True if the dart hits is within) the dartboard, and evaluate the expression for these dart coordinates: (a) (0,0) (b) (10,10) (c) (6, 6) (d) (7,8) 2.20 A ladder put up right against a wall will fall over unless put up at a certain angle less than 90 degrees. Given variables length and angle storing the length of the ladder and the angle that it forms with the ground as it leans against the wall, write a Python expression involving length and angle that computes the height reached by the ladder. Evaluate the expression for these values of length and angle: (a) 16 feet and 75 degrees (b) 20 feet and 0 degrees (c) 24 feet and 45 degrees (d) 24 feet and 80 degreesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started