Create a dictionary, numbers, with one, two and three mapping to 1, 2 and 3 respectively.
Print numbers dictionary.
Print length of numbers.
Print value 2 of numbers.
Write a function that takes one string and, using slices, returns the first three characters of it.
Define a function that takes a list and adds 'pse' to the end of it.
Define a function that takes one list as argument and returns its second to last element (the element before the last).
Write a function that takes one string and returns
its third to sixth (not including sixth) characters. Example:
>>> middle('strings')
'rin'
s1 = {1, 1, 1}
s2 = set('pse')
Given the above script, what are the values of the following variables?
| s1: | ||
| s2: |
lst = [1, 13, 111, ["a", "b", 3]]
Given the above script:
| How many elements does lst have: | ||
| What is the second element of lst: | ||
| What is type of the second element of lst: | ||
| What is the last element of lst: |
d = {1: 1, 2: 2, 3: 4}
first = 2 in d.values()
second = (1 in d) and (1 in d.values())
third = 3 in d.values()
Given the above script?
| What is the the value of first: | ||
| What is the the value of second: | ||
| What is the the value of third: |
Complete execution flow of the following program
def lower(s): return s.lower() s1, s2 = 'python', 'Python' print(lower(s1)) s2 = lower(s2) print(s2)
Complete execution flow of the following program
>>>