30. String concatenation Flashcards

1
Q

What is string concatenation? How do you add strings together?

A

-means add strings
- add a plus sign between strings

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

How is string (a built in function) written

A

str

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

How do you find out if the code : “ print (str(100) ) if it is a string or an int?

A

put type :
(type(str(100) ) )
then you fill it is a string

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

What is type conversion?

A

converting the typeof our data type and what is an example?

a = str(100)
b = int (a)
c = type(b)
print(c)

PRINTS: class int?

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

why does a = str(100)
b = int (a)
c = type(b)
print(c)

print class int?

A

because
a goes from being str, to becoming int in b, and then in c that type is confirmed, and therefore it is an int.

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