CleanCoding Python
CleanCoding Python
COURSE OUTCOME:
➢ 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 data handling and use cases diagrams
➢ To learn how to use class inheritance in Python for reusability
➢ To learn how to use exception handling in Python applications for error handling
Particulars
Unit - I
❖ Chapter - 1
➢ Introduction to Clean Code
■ What is Bad Code?
● Example 1: Avoid
● Example 2: for each code
■ What is Clean Code?
➢ Purpose of Clean Code
➢ Thought of experienced programmers
❖ Chapter - 2
➢ Meaningful Names
■ Intention Revealing Names
● Example 1: Poor Variable Names
● Example 2: Poor Method Names
● Example 3: Variable Name
■ Make Meaningful Distinctions
● Example 1: Usage of Different Words
● Example 2: Distinct Names
■ Use Pronounceable Names
● Example 1: Vocal Names
● Example 2: Short Form Names
● Example 3: Non-Pronounceable Names
● Example 4: Compare
■ Avoid Encodings and Mental Mappings
● Difference between smart and professional programmer
■ Class and Method Names
❖ Chapter - 3
➢ Functions
■ Function Size Matters
■ Blocks and Indenting
■ Do only one thing within a function
■ One level of abstraction per function
■ Use Descriptive Names
● Example 1: Verbal Names
■ Function Arguments
● Advantages of Having Less Arguments
■ Command Query Separation
■ Prefer Exceptions to Returning Error Codes
■ Extract Try/Catch Blocks
■ Error Handling Is One Thing
❖ Chapter - 4
➢ Comments
■ Good Comments
■ Good Names Can Obviate Comments
■ Types of Good Comments
● Legal Comment
Unit - II
❖ Introduction to Python
➢ What is Python?
➢ Advantages and disadvantages
➢ Downloading and installing
➢ Which version of Python
➢ Running Python Scripts
➢ Using the interpreter interactively
➢ Using variables
➢ String types: normal, raw and Unicode
➢ String operators and expressions
➢ Math operators and expressions
➢ Writing to the screen
➢ Reading from the keyboard
➢ Indenting is significant
➢ The if and elif statements
➢ While Loops
➢ Using List
➢ Dictionaries
➢ Using the for statement
➢ Opening, reading and writing a text file
➢ Using Pandas, the python data analysis library and data frames
➢ Grouping, aggregating and applying, merging and joining
➢ Dealing with syntax errors
➢ Exceptions, Handling exceptions with try/except
Unit - III
❖ Data Handling and Use Cases
➢ RE Pattern Matching
➢ Parsing Data
➢ Introduction to Regression
➢ Types of Regression
➢ Use Cases
➢ Exploratory data analysis
➢ Correlation Matrix
➢ Visualization using Matplotlib
➢ Implementing linear regression
Unit - IV
❖ Advance Concepts
➢ Machine Learning - Algorithm
➢ Algorithms – Random forest
➢ Super vector Machine
➢ Random Forest
➢ Build your own model in python
➢ Comparison between random forest and decision tree
TEXTBOOKS-
REFERENCE-
3.Python 3 Standard Library by Example,Doug Hellman,ISBN: 9780134291055, Addison-Wesley Professional; June 11,
2017; 1456 pages