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...
-
During the current year, Hitchcock Developers disposed of plant assets in the following transactions: Feb. 10 Office equipment costing $24,000 was given to a scrap dealer at no charge. At the date of...
-
West Company is a print shop that produces jobs to customer specifications. During January, Job #3051 was worked on and the following information is available: Direct material used $2,500 Direct...
-
The 2014 financial statements of LVMH Moet Hennessey-Louis Vuitton S.A. are presented in Appendix C of this book. LVMH is a Paris-based holding company and one of the worlds largest and best-known...
-
For the network shown in Figure with all times indicating weeks, answer the following questions: a. What is the impact on the end date of the project if activity B slips by two weeks? b. What is the...
-
give examples of two behavioral questions and also provide the answers that you would give to these behavioral interview questions.
-
This assignment requires you to complete the 2022 tax reporting for a fictional woman named Anna Smith. Question 1 T1 - step 4 - line 66 This is Anna's taxable income Answer: Question 2 T1 - step...
-
A firm reports EBIT of $100 million. The income statement shows depreciation of $20 million. If the tax rate is 35%, capital expenditures are $10 million, and increases in working capital are $10...
-
1. a) Consider two clusters A and B each hosting multiple applications. All applications send bursty traffic between A and B over a link E. Under what conditions is circuit switching more efficient...
-
Based on the information from the link: the book "Crafting & Executing Strategy: The Quest for Competitive Advantage: Concepts and Cases" by Arthur Thompson 22 e ,...
-
1- Given an object placed at a distance of 52 cm from a biconvex lens with a focal length of 24 cm. At what distance from the lens should an image be formed on the opposite side of the lens? 2- The...
-
Your firm has a BBB-rated corporate bond with a yield to maturity of 11.3%. A U.S. Treasury security that makes payments on the same date as your bond has a yield to maturity of 9.8%. These yields...
-
Discuss the factors that affect an investors risk tolerance and the relationship between risk and return?
-
What is the present value of 82,308 received 5 years from today assuming quarterly compounding and a discount rate of 6.5 percent?
-
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 =...
-
Determine the months in backlog using the work on hand spreadsheet. The companys revenues for the last 12 months were \($357,298\).
-
Why is it important to have a realistic budget for a project?
-
Set up a spreadsheet to calculate the financial ratios or the company.
Study smarter with the SolutionInn App