python for beginners | python full course
Krishna The Maker
In Python, strings are sequences of characters. They can be created using single or double quotes, and can be manipulated using various built-in functions. Here are some common string operations in Python:
Concatenation: You can concatenate two or more strings using the +
operator. For example, str1 + " " + str2
creates a new string that combines the two given strings.
Substring extraction: You can extract a substring from a string using indexing. For example, str = "Hello, world!"
and substring = str[7:11]
extracts the substring "world!" from the string str
.
String formatting: You can format strings using the %
operator. For example, str1 = "The current date is %s" % current_date
creates a new string that contains the current date.
String methods: Python provides several built-in methods for working with strings, such as lower()
, upper()
, strip()
, replace()
, and len()
.
String literals: You can use triple quotes ("""
or """"
) to create a raw string literal that preserves the string's line breaks and other characters.
š Welcome to the Ultimate Python Journey with KGrebel_official !! š š Connect and Engage: Got questions? Looking for coding support or just want to connect with fellow learners? Join our vibrant community on Telegram - https://t.me/+9FT6frCMfXw5Mzc1 .
Full Stack Web Development Tutorials in Hindi Playlist https://www.youtube.com/playlist?list=PL1DsB_Om8LWptrKolY2jEiV8qYTKy4sST
⢠ā Full stack web development Hindi Tutorials
Official Website
Follow us on Facebook
Follow us on Twitter
#Python, #PythonTutorials, #PythonProgramming ... https://www.youtube.com/watch?v=07fwsGdkWz8
28950989 Bytes