Skip to content

Repository files navigation

python-practice-Lec-2

A personal Python learning repository containing programming exercises, practice implementations, and mini-projects developed throughout my learning journey.

This repository contains my practice work for Lecture 02 of my Python learning journey.
The lecture focuses on working with strings, indexing, slicing, built-in string functions, and making decisions using conditional statements.


📚 Topics Covered

1. Strings

  • Creating Strings (Single, Double, Multi-line)
  • String Methods
  • Escape Sequences (\n, \t)

2. Indexing & Slicing

  • Positive Indexing
  • Negative Indexing
  • String Slicing ([start:end:step])
  • Negative Slicing & String Reversal

3. String Functions

  • Built-in Functions (len(), type())
  • String Transformations (.lower(), .upper(), .find(), .replace())
  • Combining Functions with Operations

4. Conditional Statements

  • if Statements
  • elif Chains
  • else Fallbacks
  • Nested Conditions & Logical Operators

📂 Practice Files

File Topics Questions
01_strings.py Strings, String Methods, Escape Sequences 7
02_indexing_and_slicing.py Positive/Negative Indexing, Slicing, Step Values 7
03_string_functions.py Built-in Functions, Length, String Manipulation 7
04_conditional_statements.py if, elif, else, Logical & Comparison Conditions 7
05_mini_project.py Interactive Text Analyzer & Decision Engine Mini Project

🎯 Learning Goals

By completing this lecture, you will learn how to:

  • Create and manipulate multi-line and single-line strings.
  • Apply common string methods and escape sequences.
  • Access characters using both positive and negative indexing.
  • Extract custom substrings using slicing and step modifiers.
  • Calculate string lengths and execute text transformations.
  • Implement decision-making logic using if, elif, and else.
  • Combine comparison and logical operators to build robust conditions.
  • Build interactive Python programs based on user input and dynamic logic.

🚀 Mini Project Overview

🛠️ Interactive Text Analyzer & Decision Engine (05_mini_project.py)

The final file integrates all Lecture 02 concepts into an interactive Python program.

  • Key Concepts Used: Strings, Indexing, Slicing, String Functions, Conditional Logic (if/elif/else), and User Input (input()).
  • Functionality: Accepts user text input, analyzes string characteristics (length, casing, sub-string presence), extracts key segments via slicing, and executes conditional logic based on calculated metrics.

📈 Learning Progress

  • Lecture 01 — Python Fundamentals
  • Lecture 02 — Strings & Conditional Statements
  • Lecture 03 — Pending
  • Lecture 04 — Pending
  • Lecture 05 — Pending
  • Lecture 06 — Pending
  • Lecture 07 — Pending
  • Lecture 08 — Pending
  • Lecture 09 — Pending

About

Python Lecture 02 covering strings, indexing, slicing, string functions, and conditional statements through practical exercises and a mini project.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages