Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CPT 180 Chapter 8 (1st Edition) Chapter 9 (2nd Edition) Assignment 1 Directions Using the following guidelines, create a python program. 1. Download the file
CPT 180 Chapter 8 (1st Edition) Chapter 9 (2nd Edition) Assignment 1 Directions Using the following guidelines, create a python program. 1. Download the file CPT180Stuff.zip. 2. Extract this file into the root directory of one of your computer's drives. For example, you could extract it on your C: drive or on to a USB drive such as E: drive. You should now have a folder named CPT180Stuff located in your selected location. (If using a Mac, copy the downloaded zip file to your documents folder. Extract the files here.) 3. Create a program named work withFiles.py. 4. Add three comment lines at the top of the program that contain: a. Program Name b. Program Description C. Programmer's Name (You) Write code that will do the following: a. Print out the name of the current working directory. b. Change the current working directory to the CPT180Stuff folder. c. Print out the name of the current working directory. d. Create a new folder in the CPT180Stuff folder with the name "cellphones". In your code, check and ensure that the folder does not already exist prior to attempting to create it. e. Print out the contents of the CPT180Stuff folder as shown in Example Output f. Print out the contents of the CPT180Stuff\cars folder as shown in Example Output. 9. Print out the contents of the CPT180Stuff\pets folder as shown in Example Output h. Print out the contents and file sizes of the CPT180\pets\cats folder as shown in the Example Output i. Print out the contents and file sizes of the CP1180\pets\dogs folder as shown in the Example Output. 6. Submit the workWithFiles 1.py file into the Chapter 8-9 Assignment 1 Submission Folder. 5. Example Output Le Python 3.70 Shell File Edit Shell Debug Options Window Help Python 3.7.0 (v3.7.0.1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license ()" for more information. RESTART: G:\TTC Courses\cpt180\Assignments workiithfiles.py G:\TTC Courses cpt180\Assignments G:\CPT180Stuff The CPTIBOStuff folder contains the following: ('cars', 'cellphones', 'cpt180.txt', 'pets'] The CPTI BOStuff cars folder contains the following: ['familycars', 'sportscars'] The CPT.80Stuff\pets folder contains the following: ('cats', 'dogs'] The G:\CPT180Stuff\pets cats folder contains the following: catnames.txt: 34 bytes cats.jpg: 39139 bytes The C:\CPT180Stuff\pets\dogs folder contains the following: dognames.txt: 34 bytes dogs.jpg: 59520 bytes Ln: 16 Col4
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