Day two - Data types/String Manip Flashcards

1
Q

From what number does programs always start counting?

A

From 0.

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

What are the primitive types?

A

Integer (int)
Floating (float)
Boolean (True/False)
String (str) - everything that is between comas.

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

What it the ‘type’ function and how to use it?

A

It tells you the primitive type of a string.

print(type(name))

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

What is the order of the mathematical operators?

A

PEMDAS

parenthesis (), exponents **, multip *, division /, addition +, substra - .

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

What is the round function and how to use it?

A

Is a function that round a number/count result.
print(round(10 / 2, 2))
the last 2 is basically the number of cases you want after the coma.

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

How can you calculate previous variables?

A
By repeating its name and inserting the count, when you print, you'll get the result of all of them together.
result = 10 / 2
result /= 2
print(result)
2.5
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are f-strings?

A

Function that allows you to insert various variables inside a string without having to convert their primitive type.

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