subject
Computers and Technology, 23.03.2021 20:50 61497

Create a function that takes a list containing more than one sublists as an argument or parameter. Each sublist has 2 elements. The first element is the numerator and the second element is the denominator. Return the sum of the fractions rounded to the nearest whole number.

Step 1: First, consider the sublist [18, 13]. Divide the first number in this list i. e. 18 by the second number in this list i. e. 13 using list indexing method.

Step 2: Next, consider the second sublist [4, 5]. Divide the first number in this list i. e. 4 by the second number in this list i. e. 5 using list indexing method. There can be more than two sublists. So, perform Step 1 and Step 2 using for loop.

Step 3: Calculate the sum of fractions by adding the results obtained in Step 1 and Step 2.

Step 4: Round off the result to the nearest whole number using the round() function. The syntax of round() function is:

Syntax: round(float_num, num_of_decimals)

where,

float_num is the number to be rounded.
num_of_decimals is the number of decimal places to be considered while rounding. If not specified, number will be rounded to nearest whole number.
For example:

round(2.18,1) will give 2.2
round(2.18) will give 2
Please help!!!

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:40, pnhandley01
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i. e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
image
Computers and Technology, 23.06.2019 18:40, cyn95xx
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
Answers: 2
image
Computers and Technology, 24.06.2019 03:00, SiegeHatake4534
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
image
Computers and Technology, 24.06.2019 11:30, nate1808
What does the https: // mean when you type in a website
Answers: 1
You know the right answer?
Create a function that takes a list containing more than one sublists as an argument or parameter. E...

Questions in other subjects: