COMPSCI X434 Programming Python
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
COMPSCI X434 Programming Python
2 semester units in Computer Science
Course Description
Get an introduction to the fundamentals of Python programming. Python is one of the world’s most popular programming languages as it offers multiple applications, including data science and analytics, web and database applications, system administration, scientific computing, artificial intelligence, financial analysis and more.
One of Python’s most attractive features is the simplicity of its core language, so even if you don’t have any programming experience, the content will not be overwhelming. This course covers data structures, conditionals, iteration, programming patterns, functions, object-
oriented programming, working with local and Internet files, pattern matching with regular expressions, and using modules. We will also look at standard modules for numeric and data analysis, data visualization and database connectivity.
Prerequisite
There are no prerequisites for this course.
Learning Outcomes
After successfully completing this course, you will be able to:
● Identity parts of a Python program.
● Understand the main data structures in Python: numbers, strings, lists and dictionaries.
● Employ control structures and iteration.
● Read, write and process files such as CSV and JSON.
● Use the request module to download files and access APIs.
● Work with the different levels of organization in Python: functions, classes, modules and packages.
● Create regular expressions for pattern matching.
● Install and use popular modules, including NumPy, pandas and others.
Course Materials and Technical Requirements
Required Textbook
● Lubanovic, Bill: Introducing Python: Modern Computing in Simple Packages 2nd Edition (O'Reilly Media; 2nd edition, 2019) ISBN: 978-1492051367
Recommended Text
● Ceder, Naomi: The Quick Python Book, 3rd Edition (Manning Publications, 2018) ISBN: 978-1617294037
Technical Requirements
This course is built on a Learning Management system (LMS) called Canvas. In order to use Canvas, your computer will need to meet these technical specifications.
Canvas allows you to record audio or video files of yourself and upload them in the course.
Although doing so is not required for any of the activities, using these features will enhance
your engagement in the course. If you would like to use these features, you will need to have a webcam and a microphone installed on your computer. You must take quizzes and exams on a wired internet connection to ensure complete and timely submission.
Accommodations
If you require accommodations for a disability and haven't already contacted Disabled Student Services (DSS), please read the instructions for DSS Accommodations and contact the office right away.
Learning Activities
This course is divided into 10 modules. Each module includes a combination of multimedia lectures, reading assignments, discussion assignments, assignments and, and quizzes. In
addition to these activities, the course includes a, final project and a final examination. To
ensure that you are following University policies, please carefully review the academic integrity section of the syllabus as it relates to the following activities.
Instructor's Lectures
For each module, there are short video lectures that highlight concepts that are either
particularly important or which tend to be particularly challenging for students. Please note that the lectures are not intended to be comprehensive. There will be questions on the
worksheets and exams about material that was not covered in lecture. Please read the assigned reading in the textbook and other sources before reviewing the lectures.
Reading Assignments
Each module will correspond to one or more chapters in the textbook and may also include links to readings available online. There may be questions on the worksheets, quizzes, and exams about material that was not covered in the lectures but is covered in depth in the
textbook.
Discussion Forums
Introduction Forum: In Module 1 you will introduce yourself to your instructor and fellow
students. For your introduction, you can use Canvas features to record your voice and/or a
video or yourself, or you can type your introduction. You can also click on your name at the top of the course and upload a photo so that others in the class can get a better sense of you.
All modules include a graded discussion forum assignment, for which you will post brief reports ~150-400 words. For your discussion forum submissions, you are encouraged to utilize your
textbook, internet resources, and other reliable sources as you research these topics. However, it is important that your answer submissions be written in your own words, or if it is necessary to quote from another source, please do so sparingly and provide the citation.
Your reports will be graded according to a rubric posted in the course for discussion forums.
Assignments
Assignments consist of questions that relate to the material covered in the module in which
they are assigned, and may include short answer, essay questions and coding questions. They are open-book assignments designed to help you master the material necessary to perform
well on the quizzes and the final exam. While completing your assignments, it is acceptable to utilize your textbook, internet resources, and other reliable sources to help you understand the
concepts necessary to answer the questions. However, it is important that your answer
submissions are written in your own words/code, or if it is necessary to quote from another source, please do so sparingly and provide the citation.
Quizzes
The quizzes help you check your progress in the course and acquaint you with the kinds of questions you will encounter in the final exam.
● To check your comprehension and recall of the readings and prior assignments, each quiz or exam must be taken as closed book, without the use of any print or electronic resources. Failure to do so constitutes academic dishonesty and will put you at a disadvantage when taking the final exam.
● You will have an allotted time to complete each quiz or exam. Once you open the quiz or exam, it will automatically be submitted after the allotted time, regardless of whether you have finished or not, or if you have logged out and are no longer actively participating in the quiz.
● Please take all quizzes and exams on a wired connection as a loss of connection will not be accepted as a valid excuse for incomplete submissions. Do not open and close your browser window while taking the quiz or exam.
● You are not permitted to access the next module until you have submitted each quiz.
Final Project
Note that there is both a final project and a final exam. The final project is due in Module 10. Choose one of the following options:
1. A file with a name like picture.jpg is said to have an extension of “jpg”; i.e., the
extension of a file is the part of the file after the final period in its name. Write a
program that takes as an argument the name of a directory (folder) and then finds the extension of each file. Then, for each extension found, it prints the number of files with that extension and the minimum, average, and maximum size for files with that
extension in the selected directory.
2. Write a text analyzer. It should be in a form of a function that takes a file name as an argument. It should read and analyze a text file and then print:
○ the top 5 most frequently used words in the file
○ the number of times the top 5 words are used
○ it should be sorted by most frequently used count
○ the longest word in the document
○ the average size of each word
You will submit your final project by uploading it in Module 10.
Final Exam
There will be a comprehensive, timed final exam that will be delivered online and must be completed before your course end date.
Requirements for taking the final exam:
● You must complete all assignments and have received a grade for each. You may submit assignments for one module at a time and wait for your instructor’s grades/feedback
before submitting assignments for the next module. Your instructor has up to 7 days to return graded assignments. Please plan accordingly.
● Your instructor must have approved your request to take the final exam.
● You must have been enrolled in the course for a minimum of 60 days.
● You must complete your final exam before your course end date, which is 180 days from your enrollment date. Check your Welcome letter and mark this date on your calendar.
In order to pass this course, you must pass the final exam with a grade of 70% or higher.
Academic Integrity, Research, and Proper Citation
Academic misconduct is any action or attempted action that may result in creating an unfair academic advantage for you or any other members of the academic community. This misconduct includes a wide variety of behaviors such as cheating, plagiarism, altering academic documents or transcripts, gaining access to materials before they are intended to be available, and helping another student to gain an unfair academic advantage.
As a student of UC Berkeley Extension, you are encouraged to reach out to your fellow students in your class to discuss materials and to ask each other questions, but there are limits to this collaboration. Please review the following information on academic integrity, which clearly defines what constitutes cheating, as well as plagiarism and other forms of academic misconduct. Their definitions might surprise you. As a UC Berkeley Extension student, you are also bound by the UC Berkeley Extension Code of Student Conduct.
Please review this material, and contact your instructor for clarification, if necessary. You will be asked to take your Pledge to Academic Integrity before you can access this course content.
UC Berkeley Extension takes academic misconduct very seriously. Depending upon the nature of the incident, the academic disciplinary sanction may vary but can result in consequences such as a failing grade for the course or even suspension and dismissal.
Grading & Course Policies
Grade Breakdown
Your course final grade will be assigned according to the following percentages:
● Written Assignments: 25%
● Quizzes: 15%
● Discussion Reports 10%
● Final Project 20%
● *Final Exam: 30%
*In order to pass this course, you must pass the final exam with a grade of 70% or higher. Final exam scores below 70% result in a grade of F.
Final grades follow UC Berkeley grading system, as follows:
UC Berkeley grading system |
||||||||||||
Letter Grade |
A
100- 93 |
A-
92- 90 |
B+
89- 87 |
B
86- 83 |
B-
82- 80 |
C+
79- 77 |
C
76- 73 |
C-
72- 70 |
D+
69- 67 |
D
66- 63 |
D-
62- 60 |
F
< 60 |
Percentage |
Visit the UC Berkeley grading policies and procedures page for grading information, including letter grades and other letter designations (W, I, NC, P/NP).
To view your final grade and request official transcripts, log in to your student account at extension.berkeley.edu and go to "My Enrollment History."
Course Policies
● You must submit assignments for one module at a time and wait for your instructor’s
grades/feedback before submitting assignments for the next module. Your instructor has up to 7 days to return assignments with a grade and provide feedback that will help you complete subsequent assignments. Instructors are expected to respond to email inquiries within 2 business days.
● All modules must be completed in sequential order unless otherwise noted by the instructor.
● You must be enrolled a minimum of 60 and have all your assignments completed and graded before you may take the final exam.
● You must complete your final exam on or before your course end date (180 days), and you must pass the final with a 70% score (or higher) to pass the course. Instructors have 14 days to grade final exams and submit a final course grade.
Communication & Office Hours
My office hours will be as needed. Rather than setting aside a specific time for office hours, which may not be convenient for all of you, send me an email if you have a personal question/concern related to the course, and we'll set up a time to chat in the course (chat instructions). Find the link to chat in the left navigation sidebar. Please, note: all course communication between students and the instructor must be conducted within the course site.
To contact your instructor, you can access course email by clicking on the Inbox link in the left navigation (see also Canvas tutorial on Conversations). Instructors have 2 business days to
respond to student communications and 7 days to return graded submissions unless students have been notified otherwise (e.g., because of vacation or other reasons).
Course mail may also be used to contact other students. Please ensure that you are following guidelines of the Student Code of Conduct and Academic Integrity in these interactions.
Managing Your Time in the Course
While taking an online course offers flexibility, it also requires self-discipline. In a Continuous
Enrollment course such as this one, it is your responsibility to pace yourself through the course so that you have adequate time to successfully complete the course.
Tips for Success
● Start right away.
● You have 180 days (including holidays, vacations, and the unplanned events that life
may throw at you) to complete 10 modules, the final project and take the final exam.
Remember that instructors have 7 days to return student assignments and you may only submit one assignment at a time.
● Put aside time for self-study. Take time to complete self-check questions and use your closed-book quizzes to gauge your knowledge and recall of the course material.
Remember that you will need to pass the final exam in order to pass the course.
● Reach out for support. If you feel you are not on track, contact your instructor for advice.
● Be sure to provide yourself extra time to handle unforeseen events, review material,
request exam approval, take your final exam, and have your final graded by your
instructor. Remember that final exams must be completed on or before your course end date and you must have all assignments completed (returned and graded) before yourrequest to take the exam can be approved.
● Review the final exam procedures and timelines, and ask any questions well before your course end date.
Course End Date and Course Evaluation
Course End Date
Your access to the online classroom will expire on the course end date, which is indicated in the initial email you received when you enrolled. You have 180 days to complete this course from
your course enrollment date.
Course Evaluation
UC Berkeley Extension is committed to improving our online courses and instruction. We are
interested in your online learning experience, and your candid feedback will help us plan for the future and make improvements. The evaluation does not request any personal information,
and your responses will remain strictly confidential. You can find a link to the Course Evaluation on the left side of the page, in the course navigation menu.
Canvas Tech Support
The learning management system (LMS) used in this course is Canvas, which has convenient mobile apps for phones and tablets. In order to use Canvas, your computer will need to meet these technical specifications.
Anytime you are in Canvas you can access the help menu where you can report problems, get support, and search Canvas user guides from the Help link in the left navigation.
Other Options
● Canvas Support 24/7 Hotline: 855-308-2758
● Canvas online support is available by selecting the “Help” from the left navigation
● Email: [email protected]
Course Outline
Orientation Required, including Academic Integrity Pledge and Course Policies Quizzes
Module 1: Introduction
● An Introduction to Python
● Working with Python Tools (IDLE, Jupyter)
● Identifying elements of a Python program
● Identifying types in Python
● Using numbers in Python
● Understanding variables and the namespace
● Working with Boolean types
● Using conditional statements
Module 2: Strings and Sequences
● Creating strings
● Dealing with special characters and whitespace
● Using string indexing and slicing
● Comparing strings
● Using string functions and methods
● Performing type conversion
● Using string formatting
● Distinguishing various types of sequences
● Working with indexing, slicing and deletion
● Using sequence operators and functions
● Examining list manipulation methods
● Working with tuples and sets
● Converting sequence types
Module 3: Iteration
● Understanding iteration
● Using while loops for unknown number of iterations
● Using for loops for a known number of iterations
● Working with the sequence generator function
● Applying programming patterns
● Using comprehension
Module 4: Dictionaries
● Creating and accessing dictionaries
● Working with dictionary methods
● Iterating through a dictionary
● Understanding the Counter and defaultdict Types
● Using nested containers
Module 5: File Input and Output
● Understanding filepaths
● Reading from text files
● Writing to text files
● Using exceptions to handle errors
● Understanding structured file formats: CSV and JSON
Module 6: Functions
● Introduction to procedural programming
● Defining functions
● Understanding the return statement
● Using named arguments and default values
● Working with variable number of arguments
● Understanding the namespace
Module 7: Object Oriented Programming
● Object Oriented Programming Overview
● Understand why everything in Python is an object
● Creating objects
● Working with instance members
● Defining classes
● Looking at special attributes
● Understanding class variables and methods
● Using inheritance
Module 8: Modules and Packages
● Working with the import statement
● Understanding the difference between modules and packages
● Examining the Python Package Index (PyPI)
● Using PIP to install modules
● Using the request Module to retrieve files over a network
● Calling APIs with URLs
● Creating a datetime object
● Performing datetime formatting
● Using datetime arithmetic
Module 9: Regular Expressions
● Introduction to Regular Expressions
● Working with the match object
● Getting multiple matches
● Extracting text
● Substituting text
Module 10: Other Modules
● Examining the NumPy module
● Working with the pandas module
● Plotting and visualization with Matplotlib
● Using Python Database modules
2023-08-11