Question
Language: Python 3.6.1 Interpreter: Anaconda 3.6.4 --- Program used: PyCharm --- Starter code: Shown below image --- --- elements = [ ('H', 'Hydrogen', 1, 1.008),
Language: Python 3.6.1
Interpreter: Anaconda 3.6.4
--- Program used: PyCharm --- Starter code: Shown below image ---
---
elements = [
('H', 'Hydrogen', 1, 1.008),
('He', 'Helium', 2, 4.003),
('Li', 'Lithium', 3, 6.940),
('Be', 'Beryllium', 4, 9.012),
('B', 'Boron', 5, 10.810),
('C', 'Carbon', 6, 12.011),
('N', 'Nitrogen', 7, 14.007),
('O', 'Oxygen', 8, 15.999),
('F', 'Fluorine', 9, 18.998),
('Ne', 'Neon', 10, 20.180)
]
print("Periodic Table Information")
print("Which element would you like to know about ?")
num = int(input("Enter the atomic number now :"))
print() # print the symbol of the element whose atomic number is entered by user
print() # print the Name of the element whose atomic number is entered by user
print() # print the Number of the element whose atomic number is entered by user
print() # print the Weight of the element whose atomic number is entered by user
Purpose: To practice creating and using tuples. Degree of Difficulty: Easy In this exercise, you will create a program that can display information about the first ten elements in the periodic table The periodic table of is a table of the chemical elements. It is organized by the element's atomic number (the number of protons the element has) and contains information about each element, such as atomic weight Create a List of tuples that holds the information about the first 10 elements in the periodic table ust writee the list of tuples as a literal, do not try to input it from the console). Each tuple will include: the atomic symbol, name, number, and weight. The data for each element is provided in the table below. Symbol Name Atomic Number Weight 1008 4.003 6.940 9.012 10.810 12.011 4.007 15.999 18.998 20.180 H Hydrogen He Li Be Beryllium Helium Lithium 3 4 5 6 Boron Carbon Nitrogen Oxygen Fluorine Neon 9 10 Ne Now your program should prompt the user to enter an atomic number between 1 and 1O from the console The program will then display information about the element with that atomic number on the console Sample Ouput Here is an example of what your program's console output should look like. Green text was entered by the user Periodic Table Information Which element would you like to know about? Enter the atomic number no : Symbol: N Name: Nitrogen Number: 7 Weight 14.007 What to Hand In Hand in your solution in a file called a4q4.py Also, in a separate text/PDF/RTF/DOC file, hand in the answer to this question: Why are tuples, rather than lists, appropriate for storing the information about each element? One or two sentences is enoughStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started