how to find highest mean from different lists [closed] - python

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 days ago.
Improve this question
A few students from a university have taken three exams
Python = 25, 26, 29, 28, Statistics = 23, 21, 19, 25, SQL = 29, 27, 28, 25
Please write a program which calculates mean values (no in-built function for mean) of all three tests and print the highest mean value.
Addition and other functions are allowed.
Please also report who scored the highest mark in python using programming construct.
Here I am able to find the mean but I am not sure how to write logic for comparing
It might be silly but I am new to programming.
Thanks in advance.
I have calculated mean by using length and sum later ,I am unable to derive the max mean and score.

Related

Use scenarios for complex data type in Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
As we all know in python, there is one type of data - complex . I read the doc and then cannot find the use case, when to use it, and then what's its characters?
a = 20
b = 328
c = complex(a, b)
print(type(c))
Complex data types are used for advanced calculation in Electronics and applied or astrophysics or such type, just like we use complex numbers in the real world.
Complex numbers are used in electronics and electromagnetism. A single complex number puts together two real quantities, making the numbers easier to work with. For example, in electronics, the state of a circuit element is defined by the voltage (V) and the current (I).
In python, some libraries are used these things like:-
SkiDL
PySpice
Numpy
...etc

Finding closest combinations of a given sum without replacement [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I have been dipping my feet into programming and originally was making a simple macro in VBA to find a certain combination that sum to a given number when given a list of inputs. I imagined a number of tasks and minutes to do those tasks, and inputted a number of people to divide the minutes approximately equal between them. To give a concrete example, if I had eight tasks and three people, I might have the following variables:
M = [44,39,29,77,102,35,40,59]
N = 3
Avg = sum(M)/N
I want the program to be able to find the set of combinations for each person that sum closest to the average value. For instance in this example, I would like an output of something like:
A = [102, 40], B = [44,39,59], C = [29,77,35]
If anyone can at least lead me in the right direction with regards to this project, I would be grateful. While this began as an aside from a macro for an Excel sheet, I wouldn't mind if I learned more about optimization algorithms in a more suitable language like Python.
Getting each persons work as close as possible to the mean is equivalent to max-min fair allocation problem
It’s essentially an optimization problem — google research did some work on this here
https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45386.pdf
A CS professor wrote a Python module for this https://github.com/anirudhSK/cell-codel/blob/master/schism/utils/max-min-fairness.py

How can I understand this Python "def" code? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I do not understand this code:
#Read temperature sensor
def Read_Temperature(places):
humidity, temperature = Adafruit_DHT_.read_retry(sensor, pin)
temperature = round(humidity, places)
return temperature
Can you please tell me what this code means?
humidity,temperature = Adafruit_DHT_.read_retry(sensor,pin)
This first instruction means the sensor will read the values of humidity and temperature a couple of time (which explain the read_retry). Reading the documentation, it will do so up to 15 times.
temperature = round(humidity,places)
For this one, I recommend reading the documentation you can find here : https://www.w3schools.com/python/ref_func_round.asp . It's going to round the humidity value by the number of places
Then it simply give you the temperature.

Python Wedding Seating plan [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am getting married in three months and what to attempt create a python code that will pick my seating plan for me as a project to improve my coding further. On the day there will be 10 tables for 100 guests. I want to build a sample to see how effective it is but struggling with ideas on how best to do it as I am fairly new to python coding.
I decided to start with a matrix which determines how much each guest knows each other. The more positive the number the better, the more negative the number the more they dislike each other.
Below is an example: 12 guests try would like to try and get 3 tables. Any suggestions on how to optimize this or a better way to go about it would be greatly appreciated.

How to find the maximum value in a list without using Built-in Functions in python? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'd like to create a function that will print the max value within a list of numbers.
I dont know python but the pseudocode would look something like this
max = –2147483648
for each integer n in collection
if n > max
max = n
It loops through every number in a collection. If the number (n) is bigger than the previous maximum, the maximum is set to be equal to n.

Categories

Resources