Python coding
We are producing two types of products, product A and product B. Product A is defective if the weight is greater than 10 lbs. Product B is defective if the weight is greater than 15 lbs. For a given product, we know its product_type and its weight. Design a program to screen out defective products. Starting the program with variable definition:
product_type = 'xxx'
weight = xxx
Hint: You need to figure out the product type first, and then check if the product is defective based on the weight. You may use a nested if statement like the following:
if product is A:
if product weight > 10:
the product is defective
else:
if product weight >15:
the product is defective
But you need to translate the English into Python codes.
As a challenge, you may also try a one-step if statement. such as :
if some condition is met:
the product is defective
else:
the product is normal
And the key is the bolded “some condition”.
6 years ago 10
- Assignment
- Math 009 Pre Algebra Math Quiz
- Taxation - discussion post
- SPANISH LAB SUMMER COURSE
- Assignment 2: LASA # 1: Literature Review Paper
- responce writing for it (100words)
- Excel, House cost ( Function require )
- Week 3 Review post 3 minimum of 150 words apa format
- Understanding Photosynthesis and Cellular Respiration*****Already A++ Rated Tutorial*****Use as Guide Paper*****
- Training and development 4ip