I have an array in a sub program and I want to re-use that data in a new subprogram. how would I do this?  I have heard about using a dictionary but i am not sure about how to proceed on doing so. The simpler the code the better, thank you.  def optiona():  playernames = ['A', 'B', 'C', 'D', 'E', 'F']  numjudges = 5  playerscores = [] scoresfile = open('scores.txt', 'w')  for players in playernames:     string = []     for z in range(5):         print("Enter score from Judge", z+1, "for Couple ", players, "in round 1:")         data = input()         playerscores.append(int(data))         string.append(data)     scoresfile.write(','.join(string) + '\n')     print() print('Registration complete for round 1') scoresfile.close() round2()  def round2(playerscores):            print(playerscores)   now after this, i get this error TypeError: round2() missing 1 required positional argument: 'playerscores'
What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.
Motivated by , can one prove that the order of an element in a finite group divides the order of the group without using Lagrange's theorem? (Or, equivalently, that the order of the group is an exponent for every element in the group?)  The simplest proof I can think of uses the coset proof of Lagrange's theorem in disguise and goes like this: take $a \in G$ and consider the map $f\colon G \to G$ given by $f(x)=ax$. Consider now the orbits of $f$, that is, the sets $\mathcal{O}(x)=\{ x, f(x), f(f(x)), \dots \}$. Now all orbits have the same number of elements and $|\mathcal{O}(e)| = o(a)$. Hence $o(a)$ divides $|G|$.  This proof has perhaps some pedagogical value in introductory courses because it can be generalized in a natural way to non-cyclic subgroups by introducing cosets, leading to the canonical proof of Lagrange's theorem.   Has anyone seen a different approach to this result that avoids using Lagrange's theorem? Or is Lagrange's theorem really the most basic result in finite group theory? virtualbox crash on kernel 4.13.0-26 Ubuntu 16.04 LTS Virtualbox 5.0.40 ubuntu r 115130  Today after upgrading to kernel 4.13.0-26 guest vbox machines started to crash whole ubuntu. just hard poweroff is working.  If I startup with kernel 4.10.0-42 everything works fine.  what may be the problem ? How do you determine the size of a file in C? How can I figure out the size of a file, in bytes?  #include &lt;stdio.h&gt;  unsigned int fsize(char* file){   //what goes here? } Maximal ideals in the ring of real functions on $[0,1]$ Let $S$ be the ring of all continuous functions from $[0,1]$ to $\mathbb R$. How to prove that all maximal ideals of $S$ have the form $M_{x_0}=\{f\in S \mid f(x_0)=0\}$?   Thanks in advance. Why don’t I have the Get Windows 10 icon? I want to get Windows 10, but I do not see this icon in the notification area (tray):    How do I get the icon to get Windows 10? Itemize: Identation is different between first and second line Do black holes have a moment of inertia? My question is in the title: Do black holes have a moment of inertia?  I would say that it is: $$I ~\propto~ M R_S^2,$$ where $R_S$ is the Schwarzschild radius, but I cannot find anything in the literature. Can I embed a custom font in an iPhone application? I would like to have an app include a custom font for rendering text, load it, and then use it with standard UIKit elements like UILabel. Is this possible? Can I install the free Windows 7/8 -> 10 upgrade on a new empty drive? With the new Windows 10 coming out soon as a free upgrade, I'd like to know if and how I can install the upgrade on a new HDD. I assume the files needed for Windows 10 are only for upgrading an installed copy of Windows 7 or 8 and not a standalone installer to use on an empty hard drive. Or is this assumption wrong?  I have some issues booting (an older non-working version appears in the list of OS's to choose from) and I'd like to replace my current SSD, which is too small, with a new larger capacity one, while keeping my other drives intact. The old SSD will then be removed.  If more information is needed, please let me know. After what speed air friction starts to heat up an object? I understand that air friction cools off an object at low speeds. For example, if you blow on a spoon of hot soup, it cools off. Or if you swing a hot frying pan in the air, it cools off faster.  But at higher speeds, the situation changes in the opposite. For example, consider a meteor falling on Earth. It is so fast that it heats up to such a high temperature that it burns into ashes.  What is the critical speed in which an object starts to heat up?  For example, consider a spherical object with radius of 1 meter. Let its density be 1 g/cm3 if needed. And let the air pressure be 1 atm. Assume that the temperature of the object is 400 K and the temperature of the air is 300 K. Also assume that the specific heat constant of the material is 1 cal/(gr.K). What is the critical speed for this object after which its temperature starts to rise above 500 K? What is the purpose of a serial number? I have a list of arbitrary length, and I need to split it up into equal size chunks and operate on it. There are some obvious ways to do this, like keeping a counter and two lists, and when the second list fills up, add it to the first list and empty the second list for the next round of data, but this is potentially extremely expensive.  I was wondering if anyone had a good solution to this for lists of any length, e.g. using generators.  I was looking for something useful in itertools but I couldn't find anything obviously useful. Might've missed it, though.  Related question: Is there a way to view Google Chrome browsing history past three months ago? I'm trying to find a page I looked at months ago but it looks like it's disappeared off the face of the planet. I thought I would have better luck looking through my Google Chrome browsing history, but I can't see history past September. Can I force Google Chrome to display history further into the past? Can I retrieve the history manually from a directory? Is the history data gone? Problem with ListVectorPlot3D Are virtual particles only a fictive tool in equations? There is no "action at a distance" in nature. Attraction of a piece of iron by a magnet, attraction between distant electric charges of opposite sign, have to be mediated by something. The  are proposed as an explanation.  If they have an observable effect, it seems like they must exist. If so, why do we call them virtual? It can't be that they have short lifetimes, as there are short-lived particles (resonances) that we don't call "virtual."  On the other hand, some people say that the so-called virtual particles only exist on paper, or that they are just a technique to help us handle our equations.  So what is the meaning of the word "virtual" here? Do these particles really exist, or not? AllureRestAssured , how to ignore logging headers I am using rest-assured and allureRestAssured for testing api given().header(&quot;Content-Type&quot;, &quot;application/json&quot;)                 .header(&quot;key&quot;, key()).filter(new AllureRestAssured())                 .body(body.toString())                 .post(baseURI);  Problem here is its logged headers also , which contains auth key , which I dont want to be exposed in report generated , how can I ignore that . MySQL remove duplicates from big database quick Keep iphone active while running program how to set iPhone device to stay active ( to not lock ) while my app is running ? Any idea How do I see the type of a variable whether it is unsigned 32 bit, signed 16 bit, etc.?  How do I view it? Consider a common proof of the uncountability of $(0,1]$, as presented  for example:  We assume that the reals can be arranged in a sequence $x_k$, represent every number in $x_k$ by its nonterminating decimal expansion, use the diagonal argument to create a sequence of decimal digits that differs from the nonterminating decimal expansion of each number in $x_k$ and then claim that this sequence of digits so generated must be the decimal expansion of some number not in $x_k$.  My problem is with this last step. Could it not be the case that the new sequence of digits is just the terminating decimal expansion of some number already in $x_k$?  Would it not be more correct to use the sequence $x_k$ to generate a sequence of all (both terminating and non-terminating) decimal expansion of all numbers in $[0,1)$ and then apply the diagonal argument?