Question
Hi, I have this assignment due next Monday. Python lab! Please, help me figure this one out. Thanks in advance. Lab File Trouble This lab
Hi, I have this assignment due next Monday. Python lab!
Please, help me figure this one out. Thanks in advance.
Lab File Trouble
This lab is to be done on your own.
Create a python program readdata.py that does the following:
Read in the first 10 atomic elements from the file.
Print the atomic number along with the element.
Either rename, move, or delete the elements.txt file.
Run your program again, this time an error should print saying: ERROR: File elements.txt not found. Use exception handling to do this.
Submit this program two ways:
As .py code file.
As a screenshot in .jpg or .png format showing the final answer as output.
Use this elements.txt.zip as the text file to be read. Save it to your computer and unzip it. Do not modify the contents of the elements.txt file in any way once unzipped.
Note: I get questions regularly like "Why does the file look like one, long line?". Answer: There is a difference between Windows and Unix/Linux/OS X regarding like breaks in a text file. Windows requires a CR LF character to denote a new line. Unix/Linux/OS X only needs the LF character to denote a new line. So the file looks like a single long line in Windows, but does look have individual lines on the Mac running OS X. Your Python program will work properly on both operating systems with no changes needed to the file.
Screenshot needs to show your program running twice, once with elements.txt and again with the file missing.
Note: Elements.txt.zip: HydrogenHelium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminum Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titanium Vanadium Chromium Manganese Iron Cobalt Nickel Copper Zinc Gallium Germanium Arsenic Selenium Bromine Krypton Rubidium Strontium Yttrium Zirconium Niobium Molybdenum Technetium Ruthenium Rhodium Palladium Silver Cadmium Indium Tin Antimony Tellurium Iodine Xenon Cesium Barium Lanthanum Cerium Praseodymium Neodymium Promethium Samarium Europium Gadolinium Terbium Dysprosium Holmium Erbium Thulium Ytterbium Lutetium Hafnium Tantalum Tungsten Rhenium Osmium Iridium Platinum Gold Mercury Thallium Lead Bismuth Polonium Astatine Radon Francium Radium Actinium Thorium Protactinium Uranium Neptunium Plutonium Americium Curium Berkelium Californium Einsteinium Fermium Mendelevium Nobelium Lawrencium Rutherfordium Dubnium Seaborgium Bohrium Hassium Meitnerium Darmstadtium Roentgenium Copernicium Ununtrium Flerovium Ununpentium Livermorium Ununseptium Ununoctium
Step 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