En este video les muestro como usar strings
Espero les guste y les ayude
suscribanse y denle like
http:/
#Mastery26 #TC1014 #LaNieveDeColimaExploto #PenguinLove #video
En este video les muestro como usar strings
Espero les guste y les ayude
suscribanse y denle like
http:/
#Mastery26 #TC1014 #LaNieveDeColimaExploto #PenguinLove #video
Comments Off on #Mastery26 #TC1014 #LaNieveDeColimaExploto #PenguinLove #video
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #LaNieveDeColimaExploto, #Mastery26, #PenguinLove, #TC1014, #Video
String in Python3 can be created using both pairs of singles and double quotes. They are concatenations or secuences of characters, they can be numbers, letters or special characters as long as they are inside the quotes.
String can be sliced, this means that you can get substrings from a string using the two slice operators:
Strings can also be used to perform two opperations:
For example:
>>>str = "Hello World!"
>>>print (str)
Hello World!
>>>print (str[0])
H
>>> print (str[2:5])
llo
>>>print (str[-1])
!
>>>Print (str[::-1])
!dlroW olleH
>>> Print(str+"!!")
Hello World!!!
>>>Print(str*2)
Hello World!Hello World!
As you can see String can be seen as lists in some ways. For example the [-1] index points to the last element of the array.
As you can see the [::-1] gives you the reversed string, but why? Well as I had said if you check lists in Python you will see that its called slicing, and what we are typing is that you will slice the string with a -1 step, this means from the last to the start.
Most of the information was extracted from this page.
This is my #Mastery26 of my #TC1014
Comments Off on Creating and Using Strings in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery26, #TC1014
In 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 most use it.
we can know the lenght of our string using the len() statement like this:
1.-print len(st1)—> this will give us an 11, because the string has 11 characters including spaces
Another operation with strings is performed by the index staement like this:
2.-print st1.index(“o”)—>this will give us a 4, because the letter tell us to where we will count, star of 0.
other is this one
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)
Another interesting functions are the following:
4.-print string1.upper()
5.-print string1.lower()
Which will print a new string with all letters converted to uppercase and lowercase respectively.
Also we can create a new string with other string but different, what I mean? just like this:
st1 = “Hello World”
print st1[:6] + “python”—–>this will give us “hello python”.
In this link you can found more operations and information about strings: http:/
Comments Off on Mastery 26 Creation and use of strings
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery26, #TC1014
Hi guys, in this video I show you how to use matrixes in C++. #mastery26
Strings are bits of text, and the syntax for them is anything written between quotes, as the following example:
>> string1=”Hello World”
In this example we are assigning the string to a variable called string1 which we can print, as we have learned in later posts, but printing it is not the only action we can do with strings, there are many more operations we can perform with strings and I will show you some of them in this post.
One operation that we can do is getting to know the lenght of our string by the len() statement. Example:
>>print len(string1)
This will print 11 because the string is 11 characters long, including spaces.
Another operation with strings is performed by the index staement, this will tell us the position of a given letter. Example:
>> print string1.index(“W”)
For this example, it will get printed 6, because W is in the 6th position, if we start counting from 0.
Also, a cool operation that we can do with strings is printing just a part of the whole string, for example:
>>print string1[4:8]
This will print “o Wo” because is the part of the string that goes from the 4th letter (starting from 0) to the 7th letter ( the end boundary it is not taken into account)
Another interesting functions are the following:
>>print string1.upper()
>>print string1.lower()
Which will print a new string with all letters converted to uppercase and lowercase respectively.
There are so many other operations that we can do with strings, such as concatenation, multiplication, etcetera.
If you are interested in learning more about strings, you can check this link: https:/
Comments Off on Mastery 26. Creation and use of strings
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery26, #TC1014
I created a basic program in Python with “string” variables and made a simple example using them.
In phyton, numbers can be called integers or floats, the strings are everything else that is considered as a letter or a word and any operation can not be made with strings as it can with integers, to create strings you just have to enter str() , int() for integers and float() for floats, for example:
str(0)+str(6) pyhton will print ——–> 06
int(2)+int(5) python will print ——–> 6
Comments Off on Creation and use of strings in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #222222, #333333, #8cbf99, #Mastery26
Here’s a video explaining the creation and use of strings in Python:
https:/
Oscar Ricardo López López A01229116
Comments Off on Creation and use of strings in Python #Mastery26
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #333333, #Mastery26
Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes ('...') or double quotes ("...") with the same result.(Click here to learn more).
You can turn any value into a string with the str( ) function (like seen in this program). you can also use string inputs.
str(input()).
When you make a sum of strings it will make a concatenation:
1+1=
Comments Off on #Mastery26 Strings
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery26, #TC1014, ken'sCourse, masteries
Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes ('...') or double quotes ("...") with the same result.(Click here to learn more).
You can turn any value into a string with the str( ) function (like seen in this program). you can also use string inputs.
str(input()).
When you make a sum of strings it will make a concatenation:
1+1=
Comments Off on #Mastery26 Strings
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery26, #TC1014, ken'sCourse, masteries
Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes ('...') or double quotes ("...") with the same result.(Click here to learn more).
You can turn any value into a string with the str( ) function (like seen in this program). you can also use string inputs.
str(input()).
When you make a sum of strings it will make a concatenation:
1+1=
Comments Off on #Mastery26 Strings
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery26, #TC1014, ken'sCourse, masteries