Python Tutorial for Beginners in Hindi | startswith and endswith Method in Python | String in Python

preview_player
Показать описание
Python Tutorial for Beginners in Hindi | startswith and endswith Method in Python | String in Python
This video is part of python tutorial for beginners in hindi. In this video, I have explained about two important methods used in data processing using python. First method is startswith and other one is endswith. Let's see these two methods along with examples.
queries covered:-
1) string in python
2) startswith function in python
3) endswith method in python

Hello guys,welcome to codeyug to build your computer science skills.Here,you will learn programming tutorials and computer science tutorials from basics to advanced.

source code :- will upload soon...
Thanks for watching this video
Subscribe codeyug for more programming tutorials.
About this channel:-
This channel provides free tutorials on programming,coding,web development.There are programming tutorials which covers from basics to advanced absolutely in hindi.

Our social links:-
creator:-
------shantanu kejkar-------
#string #Python #python3 #codeyug #function #startswith #endswith
#programming #coding
Рекомендации по теме
Комментарии
Автор

#startswith() and endswith()
"""
startswith is a inbuild function. Its return True if string starts with specific prefix. If not return false.

syntax:
string_name.startswith(prefix, start, end)

substring : A string or tuple to be checked.

start : starting of string (index value given)

end : ending of string (index_value - 1) """

str = "yo yo honey singh"
th = str.startswith("yo")
print(th)

str2 = "karan is new to coding"
print(str2.startswith( "karan", 2, 4)

str3 = "honey singh"
th = str.startswith("yo")
print(th)


#write a program for finding country number using startwith() function.

number = input("Enter your full number : ")
if number.startswith("+91"):
print("indian number")
elif number.startswith("+86"):
print("chinese number")
elif number.startswith("+1"):
print("American number")


#endswith()
"""This is also inbuild function . It also return true and false as result.

syntax :
string_name.endswith(suffix, start, end) """

website = input("website : ")
print(str4.endswith(".com"))

str4 = "karan singh"
print(str4.endswith("singh"))

str5 = "karan singh"
print(str5.endswith("singh", 5))

KaranSinghD-yjep