String Handling Operations Flashcards
1
Q
Casting
A
Converting a piece of data to a specific data type
2
Q
Concatenation
A
Where you connect two strings
(Normal version)
3
Q
Length of charaters
A
firstname = “zui”
Primt (len(firstname))
It would output 3
4
Q
Position of character
A
name = ‘zui’
Primt(name.index(“u”’))
Z=0
U=1
I=2
It will print out 1
5
Q
Substring
A
Where you only display certain bit of sub string
fullname = “zui pandit”
Print(fullname[0:3])
Last number will not be included
It will output “zui” without a space
6
Q
Conversion
A
Convert letter to numbers from ASCII and the other way around
Ord= letters to numbers
Chr = number to letter