String Handling in Python

preview_player
Показать описание
String Handling in Python, Create Strings, Print Strings, String Conversion, String Concatenation, and String operations in Python Language.
String Handling in Python Scripting Language:

What is String?

String is a sequence of characters written in single quotes or in double quotes or in three double quotes.

string1= 'This is single quoted string';
string2= "This is double quoted string";
string3= """This is triple quoted string""";
print (string1);
print (string2);
print (string3);

String may have Alphabets, Numbers, and Special Characters

a="India";
b= "100";
c ="India123";
d ="*&%$";
e = "123*&%$";
f ="India123*&%$";
g="Selenium With Java"

print (a);
print (b);
print (c);
print (d);
print (e);
print (f);
print (g);

How to use quotation marks in Strings?

Examples:
string1 ='Hello Python Don't';
string2 ="Python" Strings";
print (string1);
print (string2);

use Forward Slash (/) to avoid Syntax errors...

string1 ='Hello Python Don\'t';
string2 ="Python\" Strings";
print (string1);
print (string2);

Important Operations on Strings...

1. Finding string length
string1 ="Hello Python";
print (len(string1));

2. Concatenating Strings
string1 ="Hello ";
string2="Python";
print (string1 + string2);

string1 ="Hello ";
num=100;
print (string1 + str(num));

3. Print a String multiple times
string1 ="Hello ";
print (string1 *10);

4. Check whether the String having all numeric characters?
string1 ="Hello";

string2 ="Hello123";

string3 ="12345";

5. Check whether the String having all alphabetic characters?

string1 ="Hello";

string2 ="Hello123";

string3 ="12345";
--------------------------
Рекомендации по теме
Комментарии
Автор

For Class Notes, Visit:

You can copy the content/class notes from this webpage...

gcreddy
Автор

Hi Sir, please upload next python videos. thank you

ramyajyothi
Автор

Please Upload next python videos . we are waiting

asishgouda
Автор

excellent classes sir... regularly following your videos by me and my friends... waiting for next python videos.. please upload it ASAP and thanks for doing this.

PK-xzpf
Автор

please upload the Environment setup in Eclipse for python and gecko driver. I am waiting for that.
Thanks in advance...

santhoshkumarkolluri
Автор

Two video of String handling are same.... It might be loaded same mistakenly

surajbehera
welcome to shbcf.ru