169k views
1 vote
100 pints

Question # 1 Match List You have used different ways to store data. Match each definition with its type.

movieCost = 4.95

movieStars = ['Carrie Fisher', 'Harrison Ford']

movie = 'Star Wars'

movieID = 132

movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild') movieRatings = {5:'language', 3:'violence'}


words that needs to be used

string

int

float

list

dictionary

turple

1 Answer

2 votes

Answer:

movieCost=4.95

Float

movieStars = ['Carrie Fisher', 'Harrison Ford']

List

movie= 'Star Wars'

String

movieID=132

int

movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild')

Tuple

movieRatings = {5:'language', 3:'violence'}

Dictionary

Step-by-step explanation:

movieCost = 4.95

movieCost is of float type because it has a decimal point.

movieStars = ['Carrie Fisher', 'Harrison Ford']

movieStars if of list type because in Python the elements of list is inside square brackets.

List is an ordered collection. List is mutable i-e items can be added and remved from the list

movie = 'Star Wars'

movies is a string type because it is in enclosed in single quotes only.

movieID = 132

movieID is of int type because it is only number, without decimal value.

movieAwards = ('Oscar', 'Golden Globe', 'Director's Guild')

movieAwards is a tuple type because it is enclosed in round brackets or parenthesis.

Tuple is a sequence object. It is ordered collection of item. it is immutable.

movieRatings = {5:'language', 3:'violence'}

MovieRating is a dictionay type because it is in key-value pair. it is an unordered collection.

User Nikesh Joshi
by
6.5k points