From d8584fc733f77163b83c9447cfee65d9fe95aa91 Mon Sep 17 00:00:00 2001 From: urmishikha Date: Sun, 22 Dec 2024 23:41:17 +0530 Subject: [PATCH 1/3] Enhance README file with more details --- README.md | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a499cca..394b6fb 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,48 @@ # Learning-Object-Oriented-Python ![](https://www.codetriage.com/josharsh/learning-object-oriented-python/badges/users.svg) -This repository walks you through the Object Oriented Programming in python. Illustrates real world examples, working codes and going about finding a coding solution. + + +# Learning Object-Oriented Python + +This repository walks you through the concepts of **Object-Oriented Programming (OOP)** in Python. It provides real-world examples, practical coding exercises, and solutions to help you master OOP concepts effectively. + +--- + +## Table of Contents + +- [Overview](#overview) +- [Features](#features) +- [Getting Started](#getting-started) + - [Prerequisites](#prerequisites) + - [Installation](#installation) +- [Lessons](#lessons) +- [Contributing](#contributing) +- [License](#license) + +--- + +## Overview + +This repository is a comprehensive guide to learning Object-Oriented Programming in Python. Whether you're a beginner or someone looking to strengthen your OOP skills, this project has resources for you. + +--- + +## Features + +- Detailed lessons covering OOP concepts. +- Practical examples and working code. +- Real-world problem-solving approaches. + +--- + +## Getting Started + +### Prerequisites + +Before using this repository, ensure you have the following installed: + +- Python 3.6 or higher +- A code editor (e.g., VS Code, PyCharm) +- Git (for version control) + From 909ac793d57279ed0b59f7a2dff138341fdc747b Mon Sep 17 00:00:00 2001 From: urmishikha Date: Sun, 22 Dec 2024 23:43:20 +0530 Subject: [PATCH 2/3] Enhance README file with more details --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 394b6fb..990be6f 100644 --- a/README.md +++ b/README.md @@ -46,3 +46,11 @@ Before using this repository, ensure you have the following installed: - Git (for version control) +## Lessons + +Introduction to Python - Basics of Python programming. +Using Functions - Understanding Python functions. +Introduction to OOP Concepts - Core OOP principles. +OOP Implementation - Practical OOP examples. +Web Scraping - Using Python for web scraping. +String Manipulation - Advanced string operations. \ No newline at end of file From 2c00f0729bc348bd54ed28ba3e28acbc79fbe885 Mon Sep 17 00:00:00 2001 From: urmishikha Date: Mon, 23 Dec 2024 19:07:00 +0530 Subject: [PATCH 3/3] added more examples on string slicing --- .../StringSlicing.py | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/Lesson 6 - String Manipulation/StringSlicing.py b/Lesson 6 - String Manipulation/StringSlicing.py index 1589d03..b56a305 100644 --- a/Lesson 6 - String Manipulation/StringSlicing.py +++ b/Lesson 6 - String Manipulation/StringSlicing.py @@ -4,20 +4,41 @@ #OBS: always stops at the previous index(number) -print(word[2:7]) -> #Result: otosy -> #strts from 2 and ends before 7 +print(word[2:7]) #Result: otosy -> #strts from 2 and ends before 7 -print(word[:5]) -> #Result: photo -> #ends before 5 +print(word[:5]) #Result: photo -> #ends before 5 -print(word[:]) -> #Result: photosynthesis -> #print whole string +print(word[:]) #Result: photosynthesis -> #print whole string -print(word[::3]) -> #Result: ptyhi -> #print 0 and multiple of 3 afterwards +print(word[::3]) #Result: ptyhi -> #print 0 and multiple of 3 afterwards -print(word[3::3]) -> #Result: tyhi -> #print 3 and multiple of 3 afterwards +print(word[3::3]) #Result: tyhi -> #print 3 and multiple of 3 afterwards -print(word[:-1]) -> #Result: photosynthesi -> #ends before -1 +print(word[:-1]) #Result: photosynthesi -> #ends before -1 -print(word[:-7]) -> #Result: photosy -> #ends before -7 +print(word[:-7]) #Result: photosy -> #ends before -7 -print(word[::-1]) -> #Result: sisehtnysotohp -> #print string in reverse +print(word[::-1]) #Result: sisehtnysotohp -> #print string in reverse -print(word[5::-1]) -> #Result: sotohp -> #print reverse till 5 +print(word[5::-1]) #Result: sotohp -> #print reverse till 5 + +# Using slicing with reverse and specific stop: +print(word[8:3:-1]) # Result: tonyt -> Starts from 8 and goes to index 3 (exclusive) in reverse + +# Entire string in reverse: +print(word[::-1]) # Result: sisehtnysotohp -> Reverses the whole string + +# Reverse from a specific index: +print(word[7::-1]) # Result: ynotohp -> Starts from index 7 and reverses to the beginning + +# Reverse from a specific index to a specific index: +print(word[10:4:-1]) # Result: ehtony -> Starts at index 10 and reverses to index 5 (exclusive) + +# Extract with a step: +print(word[1:12:2]) # Result: htsyhs -> From index 1 to index 12 (exclusive) with step of 2 + +# Negative indices with slicing: +print(word[-1:-6:-1]) # Result: siseh -> Starts at the last character and goes back 5 characters + +# Reverse specific part: +print(word[6:0:-1]) # Result: ysohto -> Starts at index 6 and reverses to index 1 (exclusive) \ No newline at end of file