ENGR SPRING (CONTENT FOR EXAM 1) Flashcards
Float
Numbers w/ decimal point
ex.) 1.2, 1.5, 2.0
Booleans
True or False
String
Strings are made up of individual characters “strung” together
-can use ‘ ‘ or “ “
-also can use triple quotation marks
ex.) “ this is a string”
If we want to use an apostrophe on a string, what quotes do we use?
Double Quotes “ “
What is the equal sign?
=
What relational operator do you use to make something equal to? For example, it has to be that number.
==
What relational operator, do you use to make something not equal too?
!=
Less Than
<
Greater than
>
Less than or equal to
<=
Greater than or equal to
> =
A and B
Both have to be true, in order for it to be true. If, not its FALSE
A or B
TRUE, if one of them is true or both are. If not its false
not A
reverses, if its true it will become false.
if its false it becomes true
What’s the opposite of and?
or
What does not change to?
or
What’s the order of the boolean operations
Not, and, or
“2.3”.ljust(10)
sets the object to the left with 10 spaces, after it
“2.3”.rjust(10)
sets the object to the right with 10 spaces, before it
“2.3”.center(10)
sets the object in the middle with 5 spaces on each side
What is the f string format
{variable:.2f}
Can you start a variable with an underscore
yes
Can you start a variable a lower or uppercase?
yes
Can you start a variable with a number?
No