17. Consider the code shown below x = int(input('Enter a number: ')) yint (input('Enter a number:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
17. Consider the code shown below x = int(input('Enter a number: ')) yint (input('Enter a number: ')) b = x == y if x > 10: if b: if b or x > 20: elif x > 6: print('A!') if x > y: else: elif x > 4: print('B!') if y > 4: print('G!') print('C!') print('D!') print('E!') print('F!') a. If the user enters 8 for x and 4 for y, what will print out? 2 b. Is there input that would cause only A! and G! to print out? Give the input, or explain why none exists. c. Is there input that would cause only D! and G! to print out? Give the input, or explain why none exists. 17. Consider the code shown below x = int(input('Enter a number: ')) yint (input('Enter a number: ')) b = x == y if x > 10: if b: if b or x > 20: elif x > 6: print('A!') if x > y: else: elif x > 4: print('B!') if y > 4: print('G!') print('C!') print('D!') print('E!') print('F!') a. If the user enters 8 for x and 4 for y, what will print out? 2 b. Is there input that would cause only A! and G! to print out? Give the input, or explain why none exists. c. Is there input that would cause only D! and G! to print out? Give the input, or explain why none exists.
Expert Answer:
Answer rating: 100% (QA)
I will address each part of the question based on the provided Python code a If the user enters 8 for x and 4 for y what will print out To determine t... View the full answer
Related Book For
Edexcel AS And A Level Mathematics Pure Mathematics Year 1/AS
ISBN: 9781292183398
1st Edition
Authors: Greg Attwood
Posted Date:
Students also viewed these programming questions
-
Extension cords have a 50% attachment rate of all Santa purchases, gold ornaments have a 10% attachment rate of all tree purchases, and wreaths have a 10% attachment rate of all tree purchases. Given...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. The Incisors own a rental beach house in Hawaii. The beach house was rented for the full year during 2012...
-
Two different types of tips can be used in a Rockwell hardness tester. Eight coupons from test ingots of a nickel based alloy are selected, and each coupon is tested twice, once with each tip. The...
-
Watt Car Repair specializes in repairing electric cars. The company uses a 60 percent markup rate on parts to cover parts-related overhead costs and profit margin. It uses a 200 percent markup rate...
-
Identify different types of custodial funds and explain the purpose of each.
-
Record the following petty cash transactions of Handy Dan in the journal; explanations are not required. Nov 1 Established a petty cash fund with a $100 balance. 30 The petty cash fund had $33 in...
-
Oxygen at 150 K and 41.64 atm has a tabulated specific volume of 4.684cm3/g and a specific internal energy of 1706J/mol. Compute the specific enthalpy of O2 in this state.
-
What skill do you think HR managers and line managers need to develop in order to deal with conflict in the workplace ?
-
The isotope technetium-99m is used by doctors to image the skeleton and heart muscles. Fol- lowing injection, the concentration of this isotope decays exponentially in the body. a. Let N(t) represent...
-
What rule regulates the length of paragraphs?
-
To create a ResultSet object, you can either use the getResultSet() method or call the executeQuery() method. (True/False)
-
For data Tables in an Oracle Server database, a blank field must be a. Indicated by NULL Avoided b. Kept as a blank c. Indicated either by NULL or a blank d. Indicated by NULL
-
The executeQuery() method returns an integer that equals the number of rows that have been returned, and the executeUpdate() method returns a ResultSet object containing the run results. (True/False)
-
JDBC drivers are implementation dependent, which means that different applications need different drivers.(True/False)
-
To establish a connection with a DataSource object, you need to a. Create a DataSource object, set properties and use this object b. Set properties, set up a connection and perform queries c. Create...
-
Identify the Lewis acid and Lewis base in each of the following reactions. Lewis acid CI + AICI, AICI BF, + F BF NH, + H* DC NH Lewis base
-
Vectors are drawn from the center of a regular n-sided polygon in the plane to the vertices of the polygon. Show that the sum of the vectors is zero.
-
Solve these equations, giving your answers in exact form. a. e 2x 8ex + 12 = 0 b. e 4x 3e 2x = 2 c. (ln x) 2 + 2 ln x 15 = 0 d. e x 5 + 4e x = 0 e. 3e 2x + 5 = 16e x f. (ln x) 2 = 4(ln x + 3)
-
Given that x 0, find the set of values of x for which: [>/ / | a <1 5 8 d 6+ X b 5> 4/ e 25> -1/2 X2 c/ +3>2 6 7 f + <3 x2 X
-
The variation in the depth of water in a rock pool can be modelled using the function y = sin (30t), where t is the time in hours and 0 t 6. a. Sketch the function for the given interval. b. If t =...
-
You are the senior partner of a large, local audit firm. In reviewing the work of a junior staff member on a compilation engagement for Greasemonkey's Delight Inc., a local autoparts store (in which...
-
You have been assigned to audit the accounts payable of Slamtastic, a small recording company specializing in alternative music. Following is a portion of their accounts payable journal for the month...
-
The chapter discussed three issues to consider when obtaining evidence using a sample-based audit procedure: a. The number of transactions or items to examine b. The actual transactions or items to...
Study smarter with the SolutionInn App