Is it possible to name a variable 'in' in python?
<p>I am making a unit converter for a homework assignment, and I am using abbreviations for the various units of measurement as variable names, but when I try to define 'in' as a variable, it thinks I mean to use the word 'in' as if I wanted to say 'for x in y' or something like that, and I get the following error:</p>

<pre><code>  File "unit_converter-v1.py", line 13
    in = 12
     ^
  SyntaxError: invalid syntax
</code></pre>

<p>Is there any way to get around this?</p>

<p>I know I could just use the word 'inch' or 'inches' but then I would have to type 'inch' or 'inches' into the program every time I needed to convert inches, and I want to make the process as efficient as possible (I'm a senior in highschool, and my phisics teacher will allow us to use unit converters on tests and quizzes if we write the code ourselves. The point is that time is valuable and I need to be as time-efficient as possible).</p>

<p><strong>in</strong> is a reserved word, so you won't be able to use it as a variable name; the easiest solution would be to use a different name.</p>

<p>Python makes it easier to identify reserved words with the <code>keyword.iskeyword</code> function, as described <a href="http://stackoverflow.com/questions/22864221/is-the-list-of-python-reserved-words-and-builtins-available-in-a-library">here</a></p>

<p>BTW, naming things was described as the most difficult task for a developer by itworld <a href="http://www.itworld.com/article/2823759/enterprise-software/124383-Arg-The-9-hardest-things-programmers-have-to-do.html#slide10" rel="nofollow">this article</a>.</p>

python python-2.7 units-of-measurement unit-conversion