Data Types Flashcards

1
Q

Name 6 Data Types

A
Integer = 6
Real = 6.5
Boolean = True
Character = “C”
String = “Hello World”
Array = [1,2,3]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the differences between arrays and lists?

A

Arrays and lists are both used in Python to store data, but they don’t serve exactly the same purposes.
They both can be used to store any data type (real numbers, strings, etc), and they both can be indexed and iterated through
The main difference between a list and an array is the functions that you can perform to them.
For example, you can divide an array by 3, and each number in the array will be divided by 3 and the result will be printed if you request it.
If you try to divide a list by 3, Python will tell you that it can’t be done, and an error will be thrown.

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