Section 1

Preview this deck

find the average of piles = [2,8,5,7,5]

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (14)

Section 1

(14 cards)

find the average of piles = [2,8,5,7,5]

Front

sum=0 for i in piles: sum+=i print(sum/len(piles)

Back

how to create a list of integers 2-8

Front

range(2,9)

Back

create a list of numbers from 0-7 each incremented by 2

Front

range(0,8,2)

Back

are tuples immutable or mutable (can be modified or no)

Front

immutable

Back

what does .values() print

Front

just values (values in list)

Back

create a dictionary then add 2 friend with 2 random integers

Front

my_dict={} my_dict['addi']=[1,5] my_dict['sam']=[4,8]

Back

what does .keys() print

Front

just keys (names of list)

Back

find the min and max of prices = [0,8,5,7]

Front

min(prices) max(prices)

Back

what does code for i in range(5)

Front

creates a list of 5 integers with index starting at the beginning

Back

difference between tuples and lists

Front

tuples elements are in () not []

Back

code to take the sum of a list of any 5 integers

Front

sum =0; for i in range(5): sum+=i print sum

Back

what does range do (ex. range(6))

Front

create a list of integers each incremented by one [0,1,2,3,4,5,6]

Back

what does .items() print

Front

key and value

Back

to find the mean of a list what must be imported

Front

numpy

Back