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
2
Q
How is string (a built in function) written
A
str
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
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?
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.