This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class MontyHall: | |
def __init__(self): | |
self._prize_door = random.randint(1,3) | |
self._selected_door = random.randint(1,3) | |
self._removed_door = self.remove_door() | |
def remove_door(self): | |
doors = [1,2,3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import modules | |
import re | |
def sort_streets(street_list): | |
""" | |
Sort streets alphabetically, ignoring cardinal direction prefixes such as North, South, East and West | |
:param street_list: list of street names | |
""" | |
prefix = re.compile('^North|South|East|West|N\.?|S\.?|E\.?|W\.$', re.IGNORECASE) |
NewerOlder