0% found this document useful (0 votes)
226 views

Python Strings Reference Card

This document provides an overview of common string operations in Python, including creating, printing, concatenating, determining length, splitting, stripping, checking cases, and formatting strings. While the reference card does not cover every aspect of strings and text processing, it aims to help beginners get started with basic string methods and functions. More comprehensive resources on Python strings can be found on the OneCore.net tutorial website.

Uploaded by

altkommein
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views

Python Strings Reference Card

This document provides an overview of common string operations in Python, including creating, printing, concatenating, determining length, splitting, stripping, checking cases, and formatting strings. While the reference card does not cover every aspect of strings and text processing, it aims to help beginners get started with basic string methods and functions. More comprehensive resources on Python strings can be found on the OneCore.net tutorial website.

Uploaded by

altkommein
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Strings

Creating a String
s1="Mahesh";

Printing String
print s1; or pring "Value of S1",s1;

Strings and text processing is very vast field and this reference card is not enough to cover everything. This reference card is just an attempt to help newbies get started with strings and text processing.

String Concatenation
s2="Hello! "; s2+=s1; Or s3=s2+s1;

Swapcase
"This is Demo".swapcase()

Length of the String


l="this is string"; len(l);

Spliting Text
"Break this".split()

Strip Strings
"Break text".rstrip() "*** Title ***".strip('*')

String Conditionals
m="this is another text"; m.endswith('text');

Upper & Lower Case


'this is just demo'.upper() 'THIS IS JUST DEMO'.lower()

Check onecore.net for more updated ref cards and tutorials.

http://onecore.net

You might also like