ICT SECOND QUARTER EXAM

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/34

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

35 Terms

1
New cards

Sets

A collection data type made up of unordered elements

2
New cards

Curly Braces or {}

To specify sets you can use the

3
New cards

set()

To create sets you can use

4
New cards

len()

To check length you can use

5
New cards

add()

To add elements you can use

6
New cards

remove()

To delete elements you can use

7
New cards

in keyword, it will return a Boolean value

To check if a set contains a specific value use

8
New cards

Union (Vertical Bar)

Creates a union of two sets

9
New cards

Intersection (Ampersand&)

Gets the common elements between sets

10
New cards

Difference (-)

Gets the elements of the first set that are not in the second set

11
New cards

Exclusive (Caret^)

Gets all the elements in both sets except the intersecting values

12
New cards

Subset (<=)

Checks if the elements of first set are found in the second

13
New cards

Proper Subset (<)

Checks if the second set contains all the elements of the first and more

14
New cards

Superset (>=)

Checks if all the elements of the second set are found in the first

15
New cards

Proper Superset (>)

Checks if the first set contains all the elements of the second and more

16
New cards

Frozensets

Sets with immutable values

17
New cards

frozenset()

To specify a frozensets use

18
New cards

Dictionaries

A collection data type that consists of key and value pairs

19
New cards

dict()

To specify a dictionary use

20
New cards

dict() and zip()

Can also use to combine two lists are

21
New cards

get() method.

You can also get the value of a key using the

22
New cards

keys()

You can get the keys using

23
New cards

dict_keys()

A dictionary view object that supports iteration

24
New cards

dict_values()

To make a list out of the result use

25
New cards

items()

To export elements to the list composed of of key value tuples use

26
New cards

Conditionals: use if

Allow you to execute lines of code if particular conditions are met.

27
New cards

Nesting Conditions: elif

You can place other statements within conditions

28
New cards

Logical operators

Can also be used to check if conditions are met

29
New cards

Loops

It is when programming tasks can be repetitive.

30
New cards

While

keyword allows us to execute code over and over

31
New cards

for and in

To create loops we can use

32
New cards

break keyword

When you want to loop something indefinitely until conditionals met use

33
New cards

continue keywords

skips running the code for an iteration

34
New cards

range()

To create a sequence of numbers use

35
New cards

input()

To allow some interactions with a user use