Python Flashcards

1
Q

How do you create a list with numbers from 0 to 9 in Python?

A

Use the range() function with list() to convert the range into a list.

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

How do you check if a key exists in a dictionary?

A

Use the “in” keyword to check if a key is present in the dictionary.

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