#remember to rename this file to strings.py instead of strings.txt once downloaded #To pick up from the last tutorial we shall now begin some to do some string operations #To now is that there's a module within python called string but this is only needed for advanced string functions and so we don't use it ###VARIABLES### #First we will begin by talking about variables, a variable will told something such as a string or an integer #in case you're wondering, lines started with hash are commented lines, to stop something from printing either hash the line or remove it completely #1.A string is many characters surrounded by quotes and an integer is simply a form of number #Below we create a variable called "hello" and tell it to be a string equaling "hello everybody in the world world" #We create the following statement: hello = "hello everybody in the world" hello = "hello everybody in the world" #now that we have created the variable we shall now pint out its value as show below print hello #note that you can also print out a string surrounded by str, this enables you to print out other things such as integers #the example below shows this happening #2. Creating and printing integer myint = 1 #create an integer equal to one print myint #here we print out the value of the integer #3. Printing string of an integer print str(myint) #here we print out the string of the integer, this can be used to display strings and ints together #4. Adding a string to another string - (String manipulation) #ok so we have a string and we want to add another string onto it, we can do this will the follow code hello = str(hello) + str(myint) #notice what we do above, we get the string of hello and then we also add on the string of myint print hello #we can now print it #also you can add strings together like str(hello) + " " + str(hello) which will generate a space character inbetween strings #5. Incrememnting and adding an integer onto another integer #here we are going to increase the value of myint by one, this is called incrementing and we do it as shown below myint += 1 #we can now print out hte new value, the value is now 2 print myint #lastly we can add an integer onto another integer as follows myint = myint + 10 # this will add 10 onto the value of myint print myint # we print out the new value #CONGRATULATION YOU HAVE NOW COMPLETED THE SECTION ON VARIABLES, STRINGS AND INTEGERS