e[0]=p
x={1,2,3,4}
print(x)
what does it output and is it a dictionariy or set
set and it puts out
{1,2,3,4}
where does slicing start
0
text = "hello world"
print(text.uppercase())
will this pop an error
yes
what is a list denoted by
[]
e_1=['p','y','t','o','n']
e_1[0]=PP
yes will work
what does intersect do
it finds the values that are the same!
WHAT IS THE WAY THE ORDER WORKS IN THESE LIKE ::: WHAT DO THEY DO
START STOP MULTIPLY
The output of the following code will be "Not Found".
word = "Python Programming"
if "Program" in word:
result = "Found"
else:
result = "Not Found"
print(result)
false
what is dictionary denoted by
{}
what is mutable
change
set_a = {1, 2, 3, 4}
set_b = {3, 4, 5, 6}
print(set_a.intersection(set_b))
{3,4}
[1,2,3,4,5]
[5,4,3,2,1]
use ::-1 to reverse
def square_list(nums):
for i in range(len(nums)):
nums[i] = nums[i] ** 2
return nums
print(square_list([2, 4, 6]))
[4,16,36]
def update_list(x, y):
y.append(x)
return y
data = []
print(update_list(5, data))
print(update_list(10, data))
[5]
[5,10]
text1 = "Hello"
text2 = "world"
result = text1 + "my " + text2.upper() + "!"
print(result)
what does difference find
the variables that dont repeat
change to upper case
will this pop an error
students = {'John': 85, 'Emma': 92}
students['Liam'] = 78
is this fun :)
yes :3
what is immutable
unchange
create a dictionary of 4 keys and values and try negative indexing
does it work?
why or why not
it doesnt and honestly google
def square_list(nums):
for i in range(len(nums)):
nums[i] = nums[i] ** 2
return nums
print(square_list([2, 4, 6]))
true/false it will contain 3 keys
true
my_list = [1, 2, 3]
my_list.append(4, 5)
print(my_list)
what does this output.
error
from this
I love SI sessions with Lee I think SI is a fun time!
convert to lower case
split the sentence by word
count how many times each word apears
store in dictionariy where key is word and value is repeat
I will check