3. Write a Python script, Lab01_03.py that initializes p1 and p2 to 0 and display their...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. Write a Python script, Lab01_03.py that initializes p1 and p2 to 0 and display their value after the below conditions are checked. Conditions sets13 sets2 < 2 sets1 = 3 sets2 = 2 sets1 = 2 2 sets2 = 3 sets1 < 2 sets2 = 3 otherwise Sample Runs: (User inputs are shown in red.) Enter setsl :3 Enter sets2 :2 pl = 2 p2= 1 Enter sets1 : 1 Enter sets2 :4 Wrong score pl = 0 p2= 0 Operations increase p1 by 3 increase p1 by 2, increase p2 by 1 increase p1 by 1, increase p2 by 2 increase p2 by 3 print "Wrong score" Enter setsl :1 Enter sets2 :3 pl = 0 p2= 3 3. Write a Python script, Lab01_03.py that initializes p1 and p2 to 0 and display their value after the below conditions are checked. Conditions sets13 sets2 < 2 sets1 = 3 sets2 = 2 sets1 = 2 2 sets2 = 3 sets1 < 2 sets2 = 3 otherwise Sample Runs: (User inputs are shown in red.) Enter setsl :3 Enter sets2 :2 pl = 2 p2= 1 Enter sets1 : 1 Enter sets2 :4 Wrong score pl = 0 p2= 0 Operations increase p1 by 3 increase p1 by 2, increase p2 by 1 increase p1 by 1, increase p2 by 2 increase p2 by 3 print "Wrong score" Enter setsl :1 Enter sets2 :3 pl = 0 p2= 3
Expert Answer:
Answer rating: 100% (QA)
Creating a Python script Lab01Q3py to implement the given condition... View the full answer
Related Book For
Operating Systems Internals And Design Principles
ISBN: 9781292214290
9th Global Edition
Authors: Stallings William
Posted Date:
Students also viewed these programming questions
-
5. Consider the following program. We want to achieve 1 ms of delay through the code. What should be the value of N (in hex)? Consider the clock frequency to be 15 MHz. MOV CX, N HERE: NOP LOOP HERE...
-
What are the three contributing factors that lead to people feeling sexually harassed in the workplace?
-
Write a paper about IT Challenges Facing Women in Saudi Arabia
-
For each polynomial function, find (a) (-1), (b) (2), and (c) (0). f(x) = 2x - 4x + 1
-
A camera is being used with a correct exposure at f/4 and a shutter speed of (1/16) s. In order to photograph a rapidly moving subject, the shutter speed is changed to (1/128) s. Find the new f...
-
Smith Company managers received the following incomplete performance report: (Click the icon to view the incomplete performance report.) Complete the performance report. Identify the employee group...
-
The plate is deformed uniformly into the shape shown by the dashed lines. If at A, xy = 0.0075 rad., while AB = AF 0, determine the average shear strain at point G with respect to the x' and y'...
-
Activity-based costing methods are constantly being improved upon, and many websites discuss suggestions for improvement. The article in this activity outlines an alternative perspective on...
-
If f(x)=6x+7 and g(x) = 8x + 15, then d [f(x) dx g(x) 10
-
KYC's stock price can go up by 15 percent every year, or down by 10 percent. Both outcomes are equally likely. The risk free rate is 5 percent, and the current stock price of KYC is 100. (a) Price a...
-
A bakery uses the formula f(x) = 2x 4 - 7x 3 + 3x 2 + 8x to determine the profit of selling x loaves of bread. How many loaves of bread must be sold to have a profit of $4? Assume x ? 1
-
You will identify a problem or issue in your present or past workplace, or in your community. The assignment objective as provided in Unit 4, is to propose a solution to the problem or issue, and to...
-
Based on the information below, What are the early warning signs of the potential crisis? You work for a consulting firm that assists companies through crisis situations. Specifically, you assist...
-
On January 1st, Bob took a long position on one contract of January 3rd oil futures at a futures price of $100 per barrel. The spot price is $90 per barrel on January 1st. The initial margin is $20...
-
Make a business report on the establishment of a new franchisee that was opened by you as the Manager. Also cite why the previous one was closed. Please follow the following format: Introduction...
-
1. I have a 2015 Cayenne that is affected by the TDI emissions mess. I love my Cayenne and am upset that Porsche lied to me about its performance. I plan on keeping the car, but my friends, family,...
-
The following table is from a data of self-reported side effects of two groups of 100 individuals treated for Diabetic Neuropathy collected to measure the relationship between low and high dosage...
-
Find the work done in pumping all the oil (density S = 50 pounds per cubic foot) over the edge of a cylindrical tank that stands on one of its bases. Assume that the radius of the base is 4 feet, the...
-
You have executed the following C program: main () { int pid; pid = fork (); printf (%d , pid); } What are the possible outputs, assuming the fork succeeded?
-
Consider a memory-management system that uses simple paging strategy and employs registers to speed up page lookups. The associative registers have a lookup performance of 120 ns and a hit ratio of...
-
What is an embedded OS?
-
Show all the steps leading to the integral balance equation (18.6) in the text. Use the following boundary conditions and verify Eq. (18.7). (i) At \(y=0, T=T_{\mathrm{S}}\). (ii) At...
-
Consider the flat-plate heat transfer to be solved by the similarity approach. Show all the details leading to Eq. (18.15). What are the boundary conditions on \(\theta\) ? Extend your MATLAB code to...
-
For fluids with \(\operatorname{Pr} <1\) the velocity profile is assumed to be a cubic for \(y
Study smarter with the SolutionInn App