Day two - Data types/String Manip Flashcards
From what number does programs always start counting?
From 0.
What are the primitive types?
Integer (int)
Floating (float)
Boolean (True/False)
String (str) - everything that is between comas.
What it the ‘type’ function and how to use it?
It tells you the primitive type of a string.
print(type(name))
What is the order of the mathematical operators?
PEMDAS
parenthesis (), exponents **, multip *, division /, addition +, substra - .
What is the round function and how to use it?
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 can you calculate previous variables?
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
What are f-strings?
Function that allows you to insert various variables inside a string without having to convert their primitive type.