ENGR SPRING (CONTENT FOR EXAM 1) Flashcards

1
Q

Float

A

Numbers w/ decimal point

ex.) 1.2, 1.5, 2.0

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

Booleans

A

True or False

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

String

A

Strings are made up of individual characters “strung” together

-can use ‘ ‘ or “ “
-also can use triple quotation marks

ex.) “ this is a string”

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

If we want to use an apostrophe on a string, what quotes do we use?

A

Double Quotes “ “

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

What is the equal sign?

A

=

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

What relational operator do you use to make something equal to? For example, it has to be that number.

A

==

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

What relational operator, do you use to make something not equal too?

A

!=

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

Less Than

A

<

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

Greater than

A

>

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

Less than or equal to

A

<=

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

Greater than or equal to

A

> =

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

A and B

A

Both have to be true, in order for it to be true. If, not its FALSE

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

A or B

A

TRUE, if one of them is true or both are. If not its false

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

not A

A

reverses, if its true it will become false.
if its false it becomes true

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

What’s the opposite of and?

A

or

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

What does not change to?

A

or

17
Q

What’s the order of the boolean operations

A

Not, and, or

18
Q

“2.3”.ljust(10)

A

sets the object to the left with 10 spaces, after it

19
Q

“2.3”.rjust(10)

A

sets the object to the right with 10 spaces, before it

20
Q

“2.3”.center(10)

A

sets the object in the middle with 5 spaces on each side

21
Q

What is the f string format

A

{variable:.2f}

22
Q

Can you start a variable with an underscore

A

yes

23
Q

Can you start a variable a lower or uppercase?

A

yes

24
Q

Can you start a variable with a number?

A

No

25
Q

Can you put characters in variable?

A

No

26
Q

x = “true” and x = true
Are these the same?

A

No
one is string, then a boolean

27
Q

/
What do you get?

A

The division with remainder
will be a float

28
Q

//
What do you get?

A

The division without the remainder
will be the a integer

29
Q

%
What do you get?

A

The remainder without the division
Integer

30
Q

If you problem has one float number in it, what happens to the result?

A

The result will be a float, unless you convert it. But it will be a float

31
Q

If you want the remainder of a problem, what function do you use?

A

%

32
Q

If you want the division without the remainder of a problem, what function do you use?

A

//

33
Q

If you want the division with the remainder of a problem, what function do you use?

A

/