Midterm 1 - In Class

Q1 - Short Answer

What is scope? How does scope work in python? If I create a variable outside a function and inside a function, what happens?

Q2 - Pseudocode

Write pseudocode for the following problem:

Given an input list called input_list, return a list that only contains the elements that appeared once.

For example, given an input list [1, 1, 2, 3, 3, 4, 5, 5] the return values would be [2, 4]. Your pseudocode should work properly for an empty list, lists with no duplicates, lists with only duplicates, etc.

Q3 - Python Code

Write Python code for the following problem:

Given an input list of integers lst, return True if the list is in increasing (not strictly, >=) order, otherwise return False.

def is_increasing(lst):
   # Your code here