String Handling Operations Flashcards

1
Q

Casting

A

Converting a piece of data to a specific data type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Concatenation

A

Where you connect two strings

(Normal version)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Length of charaters

A

firstname = “zui”
Primt (len(firstname))

It would output 3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Position of character

A

name = ‘zui’
Primt(name.index(“u”’))
Z=0
U=1
I=2

It will print out 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Conversion

A

Convert letter to numbers from ASCII and the other way around

Ord= letters to numbers
Chr = number to letter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly