Question

For the below Python expression: Evaluate the expression Show the PROCESS for how Python evaluates the...

For the below Python expression:

  • Evaluate the expression
  • Show the PROCESS for how Python evaluates the expression (order of operations and showing the steps Python takes to evaluate the problem).  

3 % 3 * 14 == 18.2 / 8.1 and 3.1 + 15.7 * 19.1 >= 6.6 // 18 // 15.0

Homework Answers

Answer #1

Solution:-

Precedence order of operators: * / % // , + - , >= , ==

Expression 1: 3 % 3 * 14 == 18.2 / 8.1

Firstly evaluating Left hand side 3 % 3 * 14 as % , * have same precedence so you evaluation will be done in Left to Right associativity order 3 % 3 * 14 = 0 * 14 = 0

Evaluating Right hand side 18.2 / 8.1 = 2.246

Clearly, LHS is not equal to RHS so it will return FALSE.

Expression 2:  3.1 + 15.7 * 19.1 >= 6.6 // 18 // 15.0

LHS: 3.1 + 15.7 * 19.1 = 3.1 + 299.87 = 302.97 (Because * has higher precedence than +)

RHS: 6.6 // 18 // 15.0 = 0.0 // 15.0 = 0.0

Clearly LHS >= RHS so it will return TRUE.

Know the answer?
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
Similar Questions
The four data sets below were created by statistician Francis Anscomb. They show why it is...
The four data sets below were created by statistician Francis Anscomb. They show why it is important to examine the scatter plots for your data, in addition to finding the correlation coefficient, in order to evaluate the appropriateness of fitting a linear model. Set 1 Set 2 Set 3 Set 4 x y x y x y x y 10 8.04 10 9.14 10 7.46 8 6.58 8 6.95 8 8.14 8 6.77 8 5.76 13 7.58 13 8.74 13...
(PLEASE SHOW MICROSOFT EXCEL STEPS) A manufacurer of bathroom fixtures produces fiberglass bathtubs in an assebly...
(PLEASE SHOW MICROSOFT EXCEL STEPS) A manufacurer of bathroom fixtures produces fiberglass bathtubs in an assebly operations consisting of three processes: moldinig, smoothing, and painting. The number of units that can be put throught each process in an hour is shown below. (Note: the three processes are contious ans sequential; thus, no more units can be smoothed or painted than have been molded.) The labor cost Each bathtub requires 90 pounds of fiberglass, and the company has a total of...
The table below show the marginal utility, measured in utils, that Ricardo would get by purchasing...
The table below show the marginal utility, measured in utils, that Ricardo would get by purchasing various amounts of products A, B, C, and D. Column 5 shows the marginal utility Ricardo gets from saving. Assume that the prices of A, B, C, and D are, respectively, $18, $6, $4, and $24 and that Ricardo has a budget of $106. Quantity of A MU of A Quantity of B MU of B Quantity of C MU of C Quantity of...
In an effort to evaluate performance and determine where improvements can be made, management has gathered...
In an effort to evaluate performance and determine where improvements can be made, management has gathered the following data relating to activities over the last four months: Month 1 2 3 4 Quality control measures: Number of defects 201 179 140 98 Number of warranty claims 62 55 46 43 Number of customer complaints 118 112 95 74 Material control measures: Purchase order lead time 10 days 9 days 7 days 5 days Scrap as a percent of total cost...
See experiment info below The NaOH used in this lab should have been 0.1M, since you...
See experiment info below The NaOH used in this lab should have been 0.1M, since you were to make it as such (see Step 15 in lab document). Compare your standardized average molarity of NaOH in this lab to 0.1M. How do the values compare? How close was your NaOH dilution to actually being 0.1M NaOH? Calculate your percent error against the average standardized value from this lab. (You must show all work to receive credit.) step 15- Prepare an...
Comparing two drugs . Makers of generic drugs must show that they do not differ significantly...
Comparing two drugs . Makers of generic drugs must show that they do not differ significantly from the “reference” drugs that they imitate. One aspect in which drugs might differ is their extent of absorption in the blood. We have some data taken from 20 healthy nonsmoking male subjects for one pair of drugs. This is a matched pairs design. Numbers 1 to 20 were assigned at random to the subjects. Subjects 1 to 10 received the generic drug first,...
PLEASE SHOW ALL WORKING STEPS. THANKS 8. Recall in our discussion of the normal distribution the...
PLEASE SHOW ALL WORKING STEPS. THANKS 8. Recall in our discussion of the normal distribution the research study that examined the blood vitamin D levels of the entire US population of landscape gardeners. The intent of this large-scale and comprehensive study was to characterize fully this population of landscapers as normally distributed with a corresponding population mean and standard deviation, which were determined from the data collection of the entire population. Suppose you are now in a different reality in...
Write a Python 3 program called “parse.py” using the template for a Python program that we...
Write a Python 3 program called “parse.py” using the template for a Python program that we covered in this module. Note: Use this mod7.txt input file. Name your output file “output.txt”. Build your program using a main function and at least one other function. Give your input and output file names as command line arguments. Your program will read the input file, and will output the following information to the output file as well as printing it to the screen:...
read article below, give me your thoughts, 4 sentences. ty re you ready to interview your...
read article below, give me your thoughts, 4 sentences. ty re you ready to interview your interviewer? Candidates usually arrive at an interview ready to articulate their strengths and discuss their resume. However, it’s equally important to prepare to gather information and perspective in order to thoroughly evaluate the job. The questions you ask will provide you with the chance to showcase your knowledge of the company, your thoroughness, and motivation to secure the position. Add to that the opportunity...
Berton's Burgers- Rebuilding a Brand Read the overview below and complete the activities that follow. Trent...
Berton's Burgers- Rebuilding a Brand Read the overview below and complete the activities that follow. Trent Berton is in charge of all marketing for the family business, Berton's Burgers, which is a family owned and operated fast food chain in the Midwest. Berton's operates 20 different locations in 4 states. Beginning in 1974, Tom Berton, Trent's father, began selling hamburgers at a kiosk outside a library to hungry college students. Last year, Berton's Burgers reported annual sales in excess of...