PYTHON PROGRAMING

Overview:

The course is designed to provide an introduction to the Python programming language. The focus of the course is to provide students with an introduction to programming, I/O, and visualization using the Python programming language. The course will discuss topics necessary for the participant to be able to create and execute Python programs. The lectures, presentations and hands-on are designed to provide knowledge and experiences to students that serve as a foundation for continued learning of presented areas.

This course is an introduction to programming in Python using the Programming in Python. This course assumes no previous programming, math, or other experience. The course covers the first 10 chapters of the textbook and included basics of program logic and simple data structures. The focus on the course is simple data analysis. When students complete the course, they will be well prepared to take other more challenging introductory programming courses.

Learning Objectives:

The learning objectives of this course are:

  • To understand why Python is a useful scripting language for developers.
  • To learn how to design and program Python applications.
  • To learn how to use lists, tuples, and dictionaries in Python programs.
  • To learn how to identify Python object types.
  • To learn how to use indexing and slicing to access data in Python programs.
  • To define the structure and components of a Python program.
  • To learn how to write loops and decision statements in Python.
  • To learn how to write functions and pass arguments in Python.
  • To learn how to build and package Python modules for reusability.
  • To learn how to read and write files in Python.
  • To learn how to design object‐oriented programs with Python classes.
  • To learn how to use class inheritance in Python for reusability.
  • To learn how to use exception handling in Python applications for error handling.

Targeted Audience:

  • All students can take this course from high school to lifelong learners.
  • Anyone interested to learn Python can be a student of this course.
  • People who want to make their career in data analytics can take this course.

Learning Outcome:

  • Write and Understand Python Programs.
  • Self-develop any project based on python language.
  • Can apply for job specifying python as a skill.
  • Get a kick-start in the field of Data-Science like AI, Machine learning and predictive analysis.

Course Outlines

Module 1: Variables

  • Variable names and keywords
  • Statements
  • Operators and operands
  • Expressions
  • Order of operations
  • Modulus operator
  • String operations
  • Asking the user for input
  • Comments
  • Choosing mnemonic variable names
  • Debugging
  • Exercises

Module 2: Conditional execution

  • Boolean expressions
  • Logical operators
  • Conditional execution
  • Alternative execution
  • Chained conditionals
  • Nested conditionals
  • Catching exceptions using try and except
  • Short-circuit evaluation of logical expressions
  • Debugging

Module 3: Functions

  • Function calls
  • Built-in functions
  • Type conversion functions
  • Math functions
  • Random numbers
  • Adding new functions
  • Definitions and uses
  • Flow of execution
  • Parameters and arguments
  • Fruitful functions and void functions
  • Why functions?
  • Debugging



Module 4: Iteration

  • Updating variables
  • The while statement
  • Infinite loops
  • “Infinite loops” and break
  • Finishing iterations with continue
  • Definite loops using for
  • Loop patterns
  • Counting and summing loops
  • Maximum and minimum loops
  • Debugging
  • Glossary
  • Exercises

Module 5: Strings

  • A string is a sequence
  • Getting the length of a string using len
  • Traversal through a string with a loop
  • String slices
  • Strings are immutable
  • Looping and counting
  • The in operator
  • String comparison
  • string methods
  • Parsing strings
  • Format operator
  • Debugging
  • Glossary
  • Exercises

Module 6: Files

  • Persistence
  • Opening files
  • Text files and lines
  • Reading files
  • Searching through a file
  • Letting the user choose the file name
  • Using try, except, and open
  • Writing files
  • Debugging
  • Glossary
  • Exercises

Module 7: Lists

  • A list is a sequence
  • Lists are mutable
  • Traversing a list
  • List operations
  • List slices
  • List methods
  • Deleting elements
  • Lists and functions
  • Lists and strings
  • Parsing lines
  • Objects and values
  • Aliasing
  • List arguments
  • Debugging
  • Glossary
  • Exercises

Module 8: Dictionaries

  • Dictionary as a set of counters
  • Dictionaries and files
  • Looping and dictionaries
  • Advanced text parsing
  • Debugging
  • Glossary
  • Exercises

Module 9: Tuples

  • Tuples are immutable
  • Comparing tuples
  • Tuple assignment
  • Dictionaries and tuples
  • Multiple assignment with dictionaries
  • The most common words
  • Using tuples as keys in dictionaries
  • Sequences: strings, lists, and tuples - Oh My!
  • Debugging
  • Glossary
  • Exercises

Module 10: Regular expressions

  • Character matching in regular expressions
  • Extracting data using regular expressions
  • Combining searching and extracting
  • Escape character
  • Summary
  • Bonus section for Unix / Linux users
  • Debugging
  • Glossary
  • Exercises

Module 11: Networked programs

  • HyperText Transfer Protocol - HTTP
  • The World’s Simplest Web Browser
  • Retrieving an image over HTTP
  • Retrieving web pages with urllib
  • Parsing HTML and scraping the web
  • Parsing HTML using regular expressions
  • Parsing HTML using BeautifulSoup
  • Reading binary files using urllib
  • Glossary
  • Exercises

Module 12: Using Web Services

  • eXtensible Markup Language - XML
  • Parsing XML
  • Looping through nodes
  • JavaScript Object Notation - JSON
  • Parsing JSON
  • Application Programming Interfaces
  • Google geocoding web service
  • Security and API usage
  • Glossary
  • Exercises

Module 13: Object-Oriented Programming

  • Managing Larger Programs
  • Getting Started
  • Using Objects
  • Starting with Programs
  • Subdividing a Problem - Encapsulation
  • Our First Python Object
  • Classes as Types
  • Object Lifecycle
  • Many Instances
  • Inheritance
  • Summary
  • Glossary

Module 14: Using Databases and SQL

  • What is a database?
  • Database concepts
  • Database Browser for SQLite
  • Creating a database table
  • Structured Query Language summary
  • Spidering Twitter using a database
  • Basic data modeling
  • Programming with multiple tables
  • Constraints in database tables
  • Retrieve and/or insert a record
  • Storing the friend relationship
  • Three kinds of keys
  • Using JOIN to retrieve data
  • Summary
  • Debugging

Module 15: Visualizing data

  • Building a Google map from geocoded data
  • Visualizing networks and interconnections