# HG changeset patch # User Madhusudan.C.S # Date 1284727644 -19800 # Node ID cfae14bb68091c46e630f4eae3d06473d46c3ff4 # Parent 53df732199a15d760aa379486955ce3621cec1b3 Adding an uncompleted version of getting started with strings. diff -r 53df732199a1 -r cfae14bb6809 getting-started-strings.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/getting-started-strings.rst Fri Sep 17 18:17:24 2010 +0530 @@ -0,0 +1,83 @@ +3.3 LO: getting started with strings (2) [madhu] +------------------------------------------------- +* strings + + single, double, triple quoted +* accessing elements +* show immutability +* tell that there are methods for manipulation + + +Hello friends. Welcome to this spoken tutorial on Getting started with +strings. + +{{{ Show the slide containing the title }}} + +{{{ Show the slide containing the outline }}} + +In this tutorial, we will learn what do we actually mean by strings in +python, how python supports the use of strings. We will also learn +some of the operations that can be performed on strings. + +{{{ Shift to terminal and start ipython }}} + +To begin with let us start ipython, by typing:: + + ipython + +on the terminal + +So what are strings? In Python anything within either single quotes +or double quotes or triple single quotes or triple double quotes are +strings. This is true whatsoever, even if there is only one character +within the quotes + +{{{ Type in ipython the following and read them as you type }}}:: + + 'This is a string' + "This is a string too' + '''This is a string as well''' + """This is also a string""" + 'p' + +We can assign this string to any variable:: + + a = 'Hello, World!' + +Now 'a' is a string variable. String is a collection of characters. In +addition string is an immutable collection. So all the operations that +are applicable to any other immutable collection in Python works on +string as well. So we can add two strings:: + + a = 'Hello' + b = 'World' + c = a + ', ' + b + '!' + +We can add string variables as well as the strings themselves all in +the same statement. The addition operation performs the concatenation +of two strings. + + + + + + +{{{ Show summary slide }}} + +This brings us to the end of another session. In this tutorial session +we learnt + + * + + +{{{ Show the "sponsored by FOSSEE" slide }}} + +This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India + +Hope you have enjoyed and found it useful. +Thankyou + +.. Author : Madhu + Internal Reviewer 1 : [potential reviewer: Nishanth] + Internal Reviewer 2 : [potential reviewer: Amit] + External Reviewer : +