You are given a weight of 980 grams. Write a snippet to convert it to pounds and
Fantastic news! We've Found the answer you've been seeking!
Question:
You are given a weight of 980 grams. Write a snippet to convert it to pounds and ounces by :
1. using the round() function (to get to the nearest whole oz value)
2. using the floor division and modulus division operators
You Must use all three of them in order to get full credit.
Note: You are asked to find out : 980 g = ? lb + ? oz; But Not: 980 g = ? lbs; and 980 g = ? oz. You can use this conversion factor from gram to ounce: 1 oz = 28.3 g
Second Question:
Write a for loop to print these 10 numbers in one single row:
1 2 3 4 5 6 7 8 9 10
To get full credit, write Only One statement in the loop body.
Related Book For
Posted Date: