I have a python script that does incorrect math. here it is:  from random import randint while 1==1:     try:         exp = input()         if exp=="1+1":             print("=3")         else :             answer = exp             while answer == exp:                 answer = randint(0, exp+10)             print(answer)     except Exception as e:         print(e)         print(259)   when i run it, I get an error:  Traceback (most recent call last):   File "/Users/the_name_of_my_home_folder/Documents/the name of the file.py", line 1, in &lt;module&gt;     from random import randint ImportError: bad magic number in 'random': b'\x03\xf3\r\n'   I am using python 3.5.1 on a mac.
What's the "Bad magic number" ImportError in python, and how do I fix it?  The only thing I can find online suggests this is caused by compiling a .py -> .pyc file and then trying to use it with the wrong version of python. In my case, however, the file seems to import fine some times but not others, and I'm not sure why.  The information python's providing in the traceback isn't particularly helpful (which is why I was asking here...), but here it is in case it helps:  Traceback (most recent call last):   File "run.py", line 7, in &lt;module&gt;     from Normalization import Normalizer
How do comments work? Across the Stack Exchange network you may leave comments on a question or answer.  How do comments work? What are comments for, and when shouldn't I comment? Who can post comments? Who can edit comments? How can I format and link in comments? My comment doesn't contain some of the text I typed in it; why? My comment appears to be long enough, but I can't post it because it's too short; why? Who can delete comments? When should comments be deleted? Why can't I comment on specific posts even if I have enough reputation to comment? When can comments be undeleted? What are automatic comments? How can I link to comments? Anything else I should know about comments?  Also see the FAQ articles on  and . How to exclude jars generated by maven war plugin? HDMI/Displayport audio control for OS X Adapt Ubuntu to a high-DPI resolution screen How can I adapt Ubuntu to a high resolution display?  I have a display with 3200x1600px on only 11'' and everything looks really tiny. Let p be a prime. Consider the equation $\frac1x+\frac1y=\frac1p$. What are the solutions? Write down the set of distinct solutions and prove your list is complete. $x$ and $y$ are positive integers.  I have rewritten it as $\frac{(x+y)}{xy} = \frac1p$, but I don't understand where to go from here? The durability of iron tools is really starting to annoy me, but in all my hours of playing I've only stumbled across one deposit of diamond ore that provided around 7 Diamonds. What's the best way to locate more in Survival mode? Where is it most commonly found? I've got a DVD that I've burnt from an MSDN ISO. I'm not entirely sure if its Windows 7 64bit or 32bit.   How can I be sure? Why didn't the Hobbits get frostbite? How can I gear my follower post 2.0? I'm a little confused as to how I'm supposed to gear up my follower since the installation of smart loot in Loot 2.0. My follower still has most pre loot 2.0 items because I have yet to find comparables that are rolling with the right affixes.   To be clear, I play a DH and so I used the Templar as my tank. I very rarely find items that roll with Strength because smart loot sees my DH and rolls Dex for me instead. With the use of the Enchantress I thought it would get better because I could replace Dex with Strength...but that's not true. It seems as though the Enchantress will only roll Dex for me too.   With the auction house down for good, no outlet for trading, and the installation of smart loot, it seems that gearing a follower has become almost impossible unless I want to jump on another character that uses strength and get items that way. I want to find items that I can use while I'm playing. How do I gear my follower post Loot 2.0? Do I have any options other than character jumping? Young boy living on Mars discovers that his parents are robots biblatex, biber, is it possible to \printbibliography between two years? With biblatex and Biber, is it possible to print all the bibliography (\printbibliography) from (let's say) 2003 to 2008 in one section? And then in another section print all the bibliography from 2009 to 2016? I need to install more applications - can I use my external HD (samsung T5) and add an additional applications folder? I have loads of space on it and it the speeds are great. I am writing my thesis,  and i am in restructuring phase - sorting theorems where they should belong thematically. And it would be helpful to have all the proofs hidden so i am not laden with the additional information.  Is it possible to add something like hideproof to documentclass options to omit them when compiling the latex file. Valid characters in a Java class name What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)? Show that the sequence $a_0 = 1$, $a_{n+1 }= \sqrt{2+a_n}$ is monotonically increasing Given the sequence $a_0 = 1$, $a_{n+1}= \sqrt{2+a_n}$, how can I show that it is monotonically increasing?  I need it to show, that the sequence converges. I already proved boundedness but I can't figure out this last part. what are the meanings of &quot;treated observation&quot; and &quot;non-treated observation&quot; in this context ?  Further, propensity score matching is a more robust method of matching that quantitative accounting researchers frequently use (Rosenbaum &amp; Rubin, 1983). With this technique, the researcher first estimates a logit or probit regression with the treatment effect as the dependent variable (i.e., S&amp;P 500 membership, continuing with our earlier example) and independent variables that are known determinants of the treatment (possibly economic performance, firm size, age, industry, etc. in our example). From this first-stage regression, the researcher obtains propensity scores. 6 The researcher then matches each treated observation to a non-treated observation based on the distance between their propensity scores (i.e., those observations with the closest propensity scores are matched). 7 Hoi et al. (2013) utilize propensity score matching in their study that links irresponsible CSR activities with tax aggressiveness. They first generate predicted propensity scores for each firm-year using a model of the determinants of a firm engaging in a high level of negative, irresponsible CSR activity. Then, they match a treatment firm (one with a high level of negative CSR activities) to a non-treatment firm (one with a low level of, or no, negative CSR activities) by matching observations with the closest propensity scores. Hoi et al. (2013) then re- test the relation between negative CSR activities and tax aggressiveness using this matched sample. These matching techniques help mitigate the researcher’s potential failure to consider certain firm characteristics that differ between treatment and non-treatment firms (Dhaliwal et al., 2012). Conjugation: Do we cite authors or papers? When referencing to another work in a scientific paper, do we cite the paper or its author(s)?  This question is intended to clarify the conjugation of the verb that follows the reference -- especially in these cases:   One author, two papers:     Jane Doe (2015a, 2015b) list-s the very specific conditions under which...   -> lists (singular: referencing to Jane Doe) or list (plural: referencing to both papers) Several authors, one paper:     John Doe, et al. (2015) claim-s this and that.   -> claim (plural: referencing to the multiple authors of the paper) or claims (singular: referencing to the single paper). We know that $2^4 = 4^2$ and $(-2)^{-4} = (-4)^{-2}$. Is there another pair of integers $x, y$ ($x\neq y$) which satisfies the equality $x^y = y^x$? Suppose I want to know whether $\sqrt{7}\in\mathbb{Q}_5$, or more generally, whether $\sqrt{n}\in\mathbb{Q}_p$ for $n\in\mathbb{Z}$, $p$ an odd prime. What are the techniques for determining this? Am I supposed to "lift" it from $\mathbb{Z}/p\mathbb{Z}$ using Hensel's lemma? Could I see an example? Why does the definition of limits of a function have strict inequality? Definition (As written in Michael Spivak's Calculus)     The function $f$ approaches a limit $l$ near $a$ means: for every $\epsilon &gt;0$ there is some $\delta &gt; 0$ such that, for all $x$, if $0&lt;|x-a|&lt;\delta$, then $|f(x)-l|&lt;\epsilon$.   my question is: why can't it be: $$0&lt;|x-a|\leq \delta,|f(x)-l|\leq \epsilon$$ After looking at limits of functions for a long time just to grasp it's meaning and using the definition quite a lot solving homework I realized I keep writing the same inequality without really understanding why.  The only explanation given in Spivak's book for this part of the definition goes over it without explaining the inequality. I tried looking for an explanation myself but wasn't really able to find anything wrong with it. Is it also possible to write the definition like that or is there a problem with that?   (first non-homework related question :p)