#TC1014<\/a> #Mastery26<\/a><\/p>\n In this mastery I will write about strings.What are strings? Strings are characters that are enclosing in quotes. As simple as this:<\/p>\n st1= “Hello World”<\/p>\n we can do many operations with strings beginig with print that maybe is the most use it.<\/p>\n we can know the lenght of our string using the len() statement like this:<\/p>\n 1.-print len(st1)—> this will give us an 11, because the string has 11 characters including spaces<\/p>\n Another operation with strings is performed by the index staement like this:<\/p>\n 2.-print st1.index(“o”)—>this will give us a 4, because the letter tell us to where<\/span> we will count, star of 0.<\/span><\/span><\/p>\n other is this one<\/span><\/span><\/p>\n 3.- print st1[1:3]—>this will give us “el” starting countig from 0 and end in the position 2, like I say in the last post of range, that mean stop that will stop in (stop-1)<\/span><\/span><\/p>\n <\/p>\n Another interesting functions are the following:<\/p>\n 4.-print string1.upper() Which will print a new string with all letters converted to uppercase and lowercase respectively.<\/p>\n Also we can create a new string with other string but different, what I mean? just like this:<\/p>\n st1 = “Hello World”<\/p>\n print st1[:6] + “python”—–>this will give us “hello python”.<\/p>\n In this link you can found more operations and information about strings: http:\/ <\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" #TC1014 #Mastery26In this mastery I will write about strings.What are strings? Strings are characters that are enclosing in quotes. As simple as this:st1= “Hello World”we can do many operations with strings beginig with print that maybe is the… Continue reading
5.-print string1.lower()<\/p>\n