Thursday, December 27, 2018

Learn Python from Zero to Hero Part 5

Hello World,
                           This is the another part of Python tutorial series, Learn Python from Zero to Hero, This Python tutorial series will help you to learn Python from basic to advance, This tutorial series will also help you to enhance your programming skill in python, If you want to learn Python from Zero or you actually don't have any idea where to start ? So don't worry about it, Because #Abhi Hum Zinda Hain #Hahahaha.


Let me start with the Basics, click here to learn some basic about Python, Or you can also check our previous tutorial whatever you miss before, Click the given links below to check our full Python tutorial series Learn Python from Zero to Hero.

I divide this tutorial series into a parts, It makes it better, Because you don't have to loose your mind to find which is the first part of this tutorial ?,  where should i start learning this tutorial ?, You don't need to waste you time into it. So let's enjoy this tutorial series.

Learn Python from Zero to Hero Part 1.
There is our another part of this series.
Learn Python from Zero to Hero Part 2. and Than you can move on to the Part 3 and Than the last one that is Part 4.

In this Part we will learn about String Method, What exactly String Method is ?, Where to use this String Method concept ?. Let's learn with your smiley face.

String Methods :

                               There are some string methods in Python, which will makes Python rich programming language, Let's See these String Methods and for which kind of tasks these methods are used for ?.

String Method Description
count() Return the number of times the specific character is used in a string.
upper() Convert the string into Upper Case.
lower() Convert the string into Lower Case.
capitalize() Converts the first character into Upper Case.
casefold() Converts the string into Lower Case
title() Convert the string into the Title Case.
split() Splits the string at the specific separator and return a list.
splitlines() Splits the string at the line break and it also return a list.
startswith() Return true if the string starts with specific value.
endswith() Return true if the string starts with specific value.
strip() Removes the all the spaces from the string. It is a trim version of string.
lstrip() Removes the all the left spaces from the string. It is a left trim version of string.
strip() Removes the all the right spaces from the string. It is a right trim version of string.
replace() Replace a specific value with a specific value.
find() Find / Searches the specific value from the string and return the last position.
rfind() Searches / Find the specific value from the string and return the last position.
format() Formats the specific value from the string.
format_map() Formats the specific value from the string.
partition() Returns the tuple where the string is parted into three parts.
rpartition() Returns the tuple where the string is parted into three parts.
center() Return a centered string.
index() Searches the string from a specified index and Return the position 
rindex() Searches the string from a specified index and Return the last position. 
encode() Returns the encoded version of string.
expandtabs() Sets the tab size of string
isalnum() Returns true if all the characters are alphanumeric in string.
isalpha() Returns true if all the characters are alphabets in string
isdecimal() Returns true if all the characters are decimal in string.
isdigit() Returns true if all the characters are digits in string.
isidentifier() Returns true if the string is an identifier.
islower() Returns true if all the characters are in Lower Case in string.
isnumeric() Returns true if all the characters are numeric in string.
isprintable() Returns true if all the characters are printable in string.
isspace() Returns true if all the characters are whitespaces in string.
istitle() Returns true if string follow the title rule.
isupper() Returns true if all the characters are in Upper Case in string.
ljust() Returns a left justified version of string.
maketrans() Returns a translation table to be used in translations.
swapcase() Swap cases, lower case becomes upper case and vice versa.
translate() Returns a translated string.
zfill() Fills the string with a specified number of 0 values at the beginning.


Remember one thing Strings are immutable in Python. If you don't know What is immutable String ?, Please click here to know What is Immutable String ? or Why Strings are immutable in Python?. Let me clear it.

These String Methods are present in Python 2 to Python 3.6. But the Python 3.7 contains some extra features, function or methods.

Python 3.7 :

                                       Python 3.7 contains some new functions, methods and files which are absent in Python 3.6, Let's See what these functions, methods and files are ?.
breakpoint() function.
time_ns()  -  time function with Nano Second.

Python 3.7 is also have new Typing Modules or Generic Types.

Python 3.7 Methods :

_class_getitem_() :
_mro_entries_() :

Python 3.7 also have some file updation.
.pyc file  -  It is a bytecode cache files.
Hash-based .pyc files.
These .pyc file may be generated with py compile or compileall. For more you can check the Python 3.7's documentation.

At Last Thanks for Reading and don't be cheap to sharing with others...

And This Line are going to bore both of us, If you have any question about this post, Let me know in the comment section below.

, , , , ,

2 comments: