Strings in Python

 STRINGS.
 String is a data-type in python. String is created by enclosing text in   quotes. You can use either Single quotes (' ') or Double quotes (" ").

Examples: 
name="Hello "
address="This is a string"
sttring='This is single quotes string'

* Input a String:
 string_var_name=input("Enter a string")

* Length of String:

To find a length of string we use (Len) Function.
For Example :

 
print(len("Hello"))

  >> Output >> 5 >>

Some useful String Functions:
  1. strcat   (String Concatenation)
  2. strcpy  (String copy)
  3. srtcom (String Comparison)
  4. strlen   (String Length)
  5. strrev   (String Reverse)
In next page we briefly learn about string functions..


Comments

Popular posts from this blog

About RAM

Class and object in c++