Andrea Poltronieri

Results 17 comments of Andrea Poltronieri

``` def test_my_range(stop_number, expected): result = my_range(stop_number) if result == expected: return True else: return False def my_range(stop_number): result = list() start_number = 0 stop_number >= 0 while start_number <...

``` my_set = set() # this creates a new set my_set.add("Bilbo") # these 5 lines add five names my_set.add("Frodo") my_set.add("Sam") my_set.add("Pippin") my_set.add("Merry") print(my_set) ```

![untitled diagram 2](https://user-images.githubusercontent.com/44606182/48579866-f0ea2400-e91d-11e8-9749-071282036f45.jpg)

![untitled diagram](https://user-images.githubusercontent.com/44606182/48577048-6ce06e00-e916-11e8-8f20-1f90c55b15fe.jpg)

from collections import deque my_queue = deque(["Draco", "Harry", "Hermione", "Ron", "Severus"]) print(my_queue) # creates a queue containing 5 elements my_queue.popleft() print(my_queue) # deletes the first element of the queue "Draco"...

harry_potter_list = list() harry_potter_list.append('Harry') harry_potter_list.append('Draco') harry_potter_list.append('Hermione') harry_potter_list.append('Ron') harry_potter_list.append('Severus') harry_potter_list.sort() print(harry_potter_list) result: ['Draco', 'Harry', 'Hermione', 'Ron', 'Severus']

from collections import deque my_stack = deque(["Draco", "Harry", "Hermione", "Ron", "Severus"]) # this passage creates a stack containing 5 names print(my_stack) my_stack.pop() # removes the last element "Severus" print(my_stack) my_stack.pop()...