Term 2 Chapter 3 Flashcards

1
Q

What are the 2 main datatypes?

A

Numbers and Sequence

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

What are the four data types in numbers?

A

Integer: Any positive or negative whole number

Float: Positive or negative Decimals

Complex: Expressed in the from of a+bj

Boolean: True or false

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

What are the three datatypes in sequence?

A

String, Tuple and List

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

Name different operators with ther sign.

A
Addition +
Subtraction -
Multiplication *
Division /
Modulo %
Exponent **
Floor Division //
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the four built-in list functions with their definitions?

A
  1. len():It shows the number of elements in the list.
  2. Max(): It shows the elements with the maximum value in the list.
  3. Min(): It shows the element with the minimum value in the list.
  4. Sum(): It adds all the elements in the list
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give example of string, tuple and list

A
  1. String: ‘emon’ “emon”
  2. Tuple: (“Ankita, 27, 12.5, “Christian”)
  3. List: [10, 20, 30, 40]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Differentiate between tuple and list

A

Tuple: values cannot be changed (immutable)
Tuple: Round Brackets

List: Values can be changed (mutable)
List: Square Brackets

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

What are the different types of operators in Python?

A
  1. Arithmetic Operations
  2. Logical Operators
  3. Membership Operators
  4. Relational or compassion Operators
  5. Assignment operator
  6. Identify Operator
How well did you know this?
1
Not at all
2
3
4
5
Perfectly