print
statement is missing for elif
.
element = (raw_input('Enter chemical name')) name = element.lower() if name == "hydrogen": print('Atomic weight: 1.008') elif name == "helium": print('Atomic weight: 4.0026') elif name == "lithium": print('Atomic weight: 4.0026') else: print('Sorry, I do not recognize that element!')
Related Posts:
- How to open every file in a folder
- What is the maximum recursion depth in Python, and how to increase it?
- How to change the order of DataFrame columns?
- What does %s mean in a python format string?
- ImportError: No module named ‘tensorflow.python’
- How to access environment variable values
- python numpy ValueError: operands could not be broadcast together with shapes
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- Python foreach equivalent
- Python NoneType object is not callable (beginner)
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- What does if __name__ == “__main__”: do?
- How to fix IndexError: invalid index to scalar variable
- How to write inline if statement for print?
- Could not install packages due to a “Environment error :[error 13]: permission denied : ‘usr/local/bin/f2py'”
- How does numpy.newaxis work and when to use it?
- How to move a file in Python?
- Round a floating-point number down to the nearest integer?
- beyond top level package error in relative import
- How do you append to a file?
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- TypeError: cannot unpack non-iterable int objec
- Why are Python’s ‘private’ methods not actually private?
- Pandas DataFrame column to list
- Error: ” ‘dict’ object has no attribute ‘iteritems’ “
- Does Python have “private” variables in classes?
- Rename Pandas DataFrame Index
- How to upgrade pip3?
- Is module __file__ attribute absolute or relative?
- How do I convert a list of ascii values to a string in python?
- How can I compare two lists in python and return matches
- Convert DataFrame column type from string to datetime, dd/mm/yyyy format
- Why do I get a “referenced before assignment” error when assigning to a global variable in a function?
- Is there a way to perform “if” in python’s lambda?
- Remove the first character of a string
- Difference in output with waitKey(0) and waitKey(1)
- Overcome ValueError for empty array
- Python list directory, subdirectory, and files
- Parsing boolean values with argparse
- Running Jupyter via command line on Windows
- Using Pip to install packages to Anaconda Environment
- Using %matplotlib notebook after %matplotlib inline in Jupyter Notebook doesn’t work
- How to create new folder?
- How do I convert hex to decimal in Python?
- What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc?
- How to get all subsets of a set? (powerset)
- Python throws ValueError: list.remove(x): x not in list
- ‘int’ object has no attribute ‘__getitem__’
- Selecting/excluding sets of columns in pandas
- How to add title to seaborn boxplot
- Pygame mouse clicking detection
- How to update SQLAlchemy row entry?
- django MultiValueDictKeyError error, how do I deal with it
- Python, print all floats to 2 decimal places in output
- What is the perfect counterpart in Python for “while not EOF”
- Numpy.dot TypeError: Cannot cast array data from dtype(‘float64’) to dtype(‘S32’) according to the rule ‘safe’
- NumPy array is not JSON serializable
- How to XOR two strings in Python
- What’s the difference between lists enclosed by square brackets and parentheses in Python?
- python is not recognized windows 10
- Haversine Formula in Python (Bearing and Distance between two GPS points)
- How to join on multiple columns in Pyspark?
- How can I login to a website with Python?
- How do I correctly use the mod operator in MIPS?
- Does Numpy automatically detect and use GPU?
- function is not defined error in Python
- Need to install urllib2 for Python 3.5.1
- Django reverse lookup of foreign keys
- If list index exists, do X
- ImportError: No module named ‘xlrd’
- How to repeat a string with spaces?
- NameError: name ‘requests’ is not defined
- Seaborn Lineplot Module Object Has No Attribute ‘Lineplot’
- kernel keeps dying in jupyter notebook
- Moving Average Pandas
- Plotting of 1-dimensional Gaussian distribution function
- How to fix error “ERROR: Command errored out with exit status 1: python.” when trying to install django-heroku using pip
- Superscript in Python plots
- threshold in 2D numpy array
- What is the difference between ‘SAME’ and ‘VALID’ padding in tf.nn.max_pool of tensorflow?
- Is it possible to use ‘else’ in a list comprehension?
- How to randomly get 0 or 1 every time?
- jinja2.exceptions.TemplateNotFound error [duplicate]
- Loading and parsing a JSON file with multiple JSON objects
- How to get ° character in a string in python?
- What is the difference between an expression and a statement in Python?
- How to handle a Button click event
- Writing Python lists to columns in csv
- python’s re: return True if string contains regex pattern
- How to implement the –verbose or -v option into a script?
- Difference between modes a, a+, w, w+, and r+ in built-in open function?
- How can I color part of Slack incoming-webhook messages?
- How to import or include data structures (e.g. a dict) into a Python file from a separate file
- In python, how can I print lines that do NOT contain a certain string, rather than print lines which DO contain a certain string:
- input() error – NameError: name ‘…’ is not defined
- A very basic setting issue about spyder and anaconda for python
- ImportError: No module named BeautifulSoup
- How to install numpy to Python 3.5?
- How do you switch between python 2 and 3, and vice versa?
- i want to run python script in wordpress