Skip to content

Instantly share code, notes, and snippets.

View calthoff's full-sized avatar

Cory Althoff calthoff

View GitHub Profile
# Exercise 1 Solution
class Square:
square_list = []
def __init__(self):
self.square_list.append(self)
# Exercise 2 Solution
print("Hello, World!")
print(8 * 9)
#exercise 1
print("It was a bright cold day in April, and the clocks were striking thirteen."[:33])
#exercise 2
print(""" "Hi" """)
#exercise 3
print('A screaming comes across the sky.'.replace('s', '$'))
#exercise 4
# exercise 1
for c in "Camus":
print(c)
# exercise 2
print("aldous was born in 1894.".capitalize())
# exercise 3
print("Where now? Who now? When now?".split('?'))
def convert(a_string):
return float(a_string)
# Functions Exercise 1
def square(n):
return n ** 2
# Functions Exercise 2
def print_string(a_string):
print(a_string)
# Functions Exercise 3
def opt(a, b, c, d=1, f=2):
#Exercise Solution 1
class Stack:
def __init__(self):
self.items = []
def is_empty(self):
return self.items == []
def push(self, item):
# Arithmetic Operators Exercise 1
x = 15
y = 4
print(x % y)
# Arithmetic Operators Exercise 2
print(30//4)
# Arithmetic Operators Exercise 3

Video Notes

It is important to remember that there are two ways to enter your code into Python: the shell and the text editor. Make sure to play around and start getting comfortable with them both.