Back To Course Home
Programming in Python
0% completed
Introduction to Python
Introduction to PythonProgramming ParadigmsQuiz Yourself on Python's Theoretical Concepts
Python Basics
Identifiers and KeywordsPython TypesArithmetic Operators in PythonData Type ConversionsBuilt-in Functions and ModulesContainers and Python Type JargonComments, Indentation, and MultiliningClasses and ObjectsChallenge: Convert the Temperature from Fahrenheit to CentigradeSolution: Convert the Temperature from Fahrenheit to CentigradeChallenge: Print the Angles of a TriangleSolution: Print the Angles of a TriangleQuiz Yourself on Python Basics
Strings and Regular Expressions
Introduction to StringsString FunctionsConversion and ComparisonRegular ExpressionsRegex Repetition Qualifiers, Anchors, and GroupingChallenge: Replace All Occurrences of a Character in a StringSolution: Replace All Occurrences of a Character in a StringChallenge: Modify the Input StringSolution: Modify the Input StringQuiz Yourself on Strings and Regular Expressions
Decision Control Instruction
Introduction to Decision Control InstructionsDifferent Operators in ConditionsConditional ExpressionsThe input and pass StatementsChallenge: Calculate the Grade Obtained by a StudentSolution: Calculate the Grade Obtained by a StudentChallenge: Determine Whether a Year is a Leap Year or NotSolution: Determine Whether a Year is a Leap Year or NotQuiz Yourself on Decision Control Instruction
Repetition Control Instruction
Introduction to Repetition Control InstructionsUsage of the while LoopUsage of the for LoopThe break and continue Statements and the else BlockChallenge: Multiplication Table for a Given NumberSolution: Multiplication Table for a Given NumberChallenge: Find the Reverse of the InputSolution: Find the Reverse of the InputQuiz Yourself on Repetition Control Instruction

Course Assessment

Periodic Test: Basics of Python
Console Input/Output
Console InputConsole OutputChallenge: Compute the Average of an Arbitrary Number of InputsSolution: Compute the Average of an Arbitrary Number of InputsQuiz Yourself on Console Input/Output
Lists
Introduction to ListsBasic List OperationsBuilt-in Functions and List MethodsSorting and ReversingList VarietiesStack and QueueChallenge: Calculate the Mean, Median, and Mode of a ListSolution: Calculate the Mean, Median, and Mode of a ListChallenge: Separating Positive and Negative Numbers from a ListSolution: Separating Positive and Negative Numbers from a ListQuiz Yourself on Lists
Tuples
Introduction to TuplesBasic Tuple OperationsBuilt-in Functions and Tuple MethodsTuple VarietiesChallenge: Find the Number of Days between Two Date TuplesSolution: Find the Number of Days between Two Date TuplesChallenge: Remove Empty Tuples from a ListSolution: Remove Empty Tuples from a ListQuiz Yourself on Tuples
Sets
Introduction to SetsBasic Set OperationsBuilt-in Functions and Set MethodsSet Operations and VarietiesChallenge: Remove All Duplicate ElementsSolution: Remove All Duplicate ElementsChallenge: Separate the Names in a Set into Two SetsSolution: Separate the Names in a Set into Two SetsQuiz Yourself on Sets
Dictionaries
Introduction to DictionariesBasic Dictionary OperationsBuilt-in Functions and Dictionary MethodsDictionary VarietiesChallenge: Create a Dictionary and Replace Key-value PairsSolution: Create a Dictionary and Replace Key-value PairsChallenge: Create Two Dictionaries and Compute the Total BillSolution: Create Two Dictionaries and Compute the Total BillQuiz Yourself on Dictionaries

Course Assessment

Periodic Test: Python Containers
Comprehensions
List ComprehensionSet and Dictionary ComprehensionChallenge: Generate the First 20 Fibonacci NumbersSolution: Generate the First 20 Fibonacci NumbersChallenge: Separate Positive and Negative Numbers from a ListSolution: Separate Positive and Negative Numbers from a ListQuiz Yourself on Comprehension
Functions
Introduction to Functions
Arguments
Challenge: Calculate the Number of Uppercase and Lowercase Letters
Solution: Calculate the Number of Uppercase and Lowercase Letters
Quiz Yourself on Functions
Recursion
Introduction to RecursionRecursive ProblemsRecursion Types and LimitChallenge: Count the Number of Vowels in a StringSolution: Count the Number of Vowels in a StringQuiz Yourself on Recursion
Functional Programming
Introduction to Functional ProgrammingLambda FunctionsHigher-Order FunctionsUsing Lambda with Map, Filter, and ReduceChallenge: Print an Unpacked List of Areas of CirclesSolution: Print an Unpacked List of Areas of CirclesQuiz Yourself on Functional Programming
Modules and Packages
Introduction to ModulesImporting a ModulePackagesQuiz Yourself on Modules and Packages
Namespaces
Symbol Table and NamespaceThe globals( ) and locals( ) FunctionsInner Functions, Scope, and the LEGB RuleQuiz Yourself on Namespaces

Course Assessment

Periodic Test: Comprehensions, Functions, Modules, and Packages
Classes and Objects
Introduction to Classes and ObjectsClasses and Objects in ProgrammingObject InitializationClass Variables and MethodsChallenge: Write a Class that Maintains an IntegerSolution: Write a Class that Maintains an IntegerQuiz Yourself on Classes and Objects
Intricacies of Classes and Objects
Identifier Naming ConventionCalling FunctionsOperator OverloadingEverything Is an ObjectImitating a Structure and Type ConversionChallenge: Define a Class that Performs Operations on a StringSolution: Define a Class that Performs Operations on a StringQuiz Yourself on the Intricacies of Classes and Objects
Containership and Inheritance
Introduction to Containership and InheritanceContainership in PythonInheritance in PythonWhat is Accessible Where?Features and Types of InheritanceAbstract Classes and PolymorphismChallenge: Create an Abstract Class and Derive Classes from ItSolution: Create an Abstract Class and Derive Classes from ItQuiz Yourself on Containership and Inheritance
Iterators and Generators
Iterables, Iterators, and the zip( ) FunctionIterators and User-defined IteratorsGenerators and Generator ExpressionsChallenge: Generate a List of Questions and Possible AnswersSolution: Generate a List of Questions and Possible AnswersChallenge: Use a Generator to Find the Max Score for a StudentSolution: Use a Generator to Find the Max Score for a StudentQuiz Yourself on Iterators and Generators

Course Assessment

Periodic Test: Object Oriented Programming
Exception Handling
What Can Go Wrong?Syntax Errors and ExceptionsHow to Deal with ExceptionsThe try and except BlocksUser-defined ExceptionsThe else and finally BlocksChallenge: Print the Square of a Positive NumberSolution: Print the Square of a Positive NumberQuiz Yourself on Exception Handling
File Input/Output
Basic I/O SystemRead/Write OperationsFile Opening ModesMoving within a FileSerialization and DeserializationSerialization of User-defined TypesFile and Directory OperationsChallenge: Append One File's Contents to the End of AnotherSolution: Append One File's Contents to the End of AnotherQuiz Yourself on File I/O
Miscellany
Documentation StringsCommand-line ArgumentsBitwise Operators and AssertionDecoratorsDecorating Functions with ArgumentsUnicode and Bytes Data TypeChallenge: Program Usage at the Command Prompt as a UtilitySolution: Program Usage at the Command Prompt as a UtilityChallenge: Checking Specific Bits in an Unsigned IntegerSolution: Checking Specific Bits in an Unsigned IntegerQuiz Yourself on Miscellany
Concurrency and Parallelism
Introduction to Concurrency, Parallelism, and ThreadsConcurrency and Parallelism in ProgrammingPerformance with ConcurrencyTypes of ConcurrenciesProperties of Thread, Launching Ways, and Parameters PassingChallenge: Copying Content into Files Using ThreadsSolution: Copying Content into Files Using ThreadsQuiz Yourself on Concurrency and Parallelism
Synchronization
Introduction to SynchronizationMechanisms for Sharing ResourcesMechanisms for Interthread Communication (ITC)Challenge: Create Random Numbers and Print a Square and a Cube via ThreadsSolution: Create Random Number and Print a Square and a Cube via ThreadsQuiz Yourself on Synchronization

Course Assessment

Periodic Test: Advanced Topics
NumPy Library
Creation of Array and Filler ArraysArray Attributes and OperationsArithmetic and Statistical OperationsLinear Algebra and Bitwise OperationsCopying, Sorting, and ComparisonIndexing, Slicing, and Array ManipulationChallenge: Practice Some Basic Methods from the NumPy LibrarySolution: Practice Some Basic Methods from the NumPy LibraryChallenge: Practice More Methods from the NumPy LibrarySolution: Practice More Methods from the NumPy LibraryQuiz Yourself on the NumPy Library
Appendix
Python Specification and InstallationPython Resources, Packages, and ToolsCompilation ApproachPreventing Bugs

Arguments

Learn about the usage of different types of arguments in functions.

We'll cover the following
  • Types of arguments
    • Positional arguments
    • Keyword arguments
    • Using both positional and keyword arguments
    • Variable-length positional arguments
    • Variable-length keyword arguments
    • Using both required and optional arguments
    • Default value as argument
  • Unpacking arguments

Get hands-on with 1400+ tech skills courses.