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
__author__ = 'David Gotz, [email protected], Onyen = gotz' | |
# Define the superclass Vehicle | |
class Vehicle: | |
# Define the initialization method | |
def __init__(self, driver): | |
self.driver = driver | |
self.passengers = None | |
# Load a list of passengers into the vehicle |
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
__author__ = 'David Gotz, [email protected], Onyen = gotz' | |
# Define the superclass Vehicle | |
class Vehicle: | |
# Define the initialization method | |
def __init__(self, driver): | |
self.driver = driver | |
self.passengers = None |
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 | |
# Playing Card class, represents a single playing card. | |
class PlayingCard: | |
# Value should be 1-13, with 1 for Ace, 11 for Jack, etc. | |
def __init__(self, value, suit): | |
# Setup the instance variables. | |
self.value = value | |
self.suit = suit |
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 | |
# Playing Card class, represents a single playing card. | |
class PlayingCard: | |
# Value should be 1-13, with 1 for Ace, 11 for Jack, etc. | |
def __init__(self, value, suit): | |
# Setup the instance variables. | |
self.value = value | |
self.suit = suit |
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
# Get a list of names | |
def get_name_list(): | |
name_list = [] | |
name = input("Enter name #1 (or press enter to stop): ") | |
# Keep going until the empty string is returned by input. | |
while name != "": | |
# Append the most recent name and ask the user for the next name. | |
name_list.append(name.upper()) | |
name = input("Enter name #"+str(len(name_list)+1)+" (or press enter to stop): ") |
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 | |
# Playing Card class, represents a single playing card. | |
class PlayingCard: | |
# Value should be 1-13, with 1 for Ace, 11 for Jack, etc. | |
def __init__(self, value, suit): | |
# Setup the instance variables. | |
self.value = value | |
self.suit = suit |
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 | |
# Playing Card class, represents a single playing card. | |
class PlayingCard: | |
def __init__(self, value, suit): | |
# Setup the instance variables. | |
if value == 1: | |
value = 'Ace' | |
elif value == 11: | |
value = 'Jack' |
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
# Playing Card class, represents a single playing card. | |
class PlayingCard: | |
def __init__(self, value, suit): | |
# Setup the instance variables. | |
self.value = value | |
self.suit = suit | |
self.face_up = False | |
def get_suit(self): | |
return self.suit |
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
# Playing Card class, represents a single playing card. | |
class PlayingCard: | |
def __init__(self, value, suit): | |
# Setup the instance variables. | |
self.value = value | |
self.suit = suit | |
self.face_up = False | |
def main(): |
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 | |
MAX_NUMBER = 10 | |
def user_picks(): | |
user_numbers = set() | |
# Add six numbers to the set. | |
while len(user_numbers) < 6: |