Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
67f14d7
Update worksheet_01.txt
ConnerW1719 Nov 1, 2017
60aec49
Update worksheet_01.txt
ConnerW1719 Nov 2, 2017
b380e77
Update lab_01_part_a.py
ConnerW1719 Nov 2, 2017
f1485aa
Update lab_01_part_b.py
ConnerW1719 Nov 2, 2017
a633e6d
Update lab_01_part_c.py
ConnerW1719 Nov 3, 2017
522accc
Update worksheet_02.txt
ConnerW1719 Nov 3, 2017
d5fb816
Update worksheet_02.txt
ConnerW1719 Nov 3, 2017
b7dc3f4
Update worksheet_03.txt
ConnerW1719 Nov 3, 2017
14582ea
Update worksheet_03.txt
ConnerW1719 Nov 6, 2017
e8329ef
Update worksheet_03.txt
ConnerW1719 Nov 6, 2017
92159fa
Update worksheet_03.txt
ConnerW1719 Nov 6, 2017
554da54
Update main_program.py
ConnerW1719 Nov 7, 2017
cd2ef1f
Update main_program.py
ConnerW1719 Nov 7, 2017
c558463
Update worksheet_04.txt
ConnerW1719 Nov 8, 2017
48e43fb
Update worksheet_04.txt
ConnerW1719 Nov 9, 2017
c0fb864
Update main_program.py
ConnerW1719 Nov 10, 2017
4da99e9
Update worksheet_04.txt
ConnerW1719 Nov 10, 2017
3883ce7
Update main_program.py
ConnerW1719 Nov 10, 2017
e89db7d
Update worksheet_05.txt
ConnerW1719 Nov 10, 2017
5438b1e
Update worksheet_05.txt
ConnerW1719 Nov 11, 2017
14bfc37
Update main_program.py
ConnerW1719 Nov 11, 2017
e9cf1ba
problems 1 through 4 worksheet 6
ConnerW1719 Nov 14, 2017
734afc6
completed chapter 6 worksheet
ConnerW1719 Nov 15, 2017
3d9d305
Forgot to save and commit through process of this part, finished Lab …
ConnerW1719 Nov 15, 2017
2b96621
Fixed the date and description of Lab 06 part 1
ConnerW1719 Nov 15, 2017
7c7ed46
Started getting the base outline of code for Lab 06 part 2
ConnerW1719 Nov 15, 2017
8e45c40
finished Lab 6 part 2, overcame struggles with code through lyles's h…
ConnerW1719 Nov 16, 2017
5d1cf1e
Lab 6 part 4, so far I have gotten the window to open.
ConnerW1719 Nov 16, 2017
34d83bc
I completed Lab 6 part 4.
ConnerW1719 Nov 16, 2017
0ed6251
Merging to make Git Push work?
ConnerW1719 Nov 16, 2017
92d452d
Delete Chapter_06#10.py
ConnerW1719 Nov 16, 2017
8fd8106
Delete Chapter_06#11.py
ConnerW1719 Nov 16, 2017
daf9ca4
Delete Chapter_06#12.py
ConnerW1719 Nov 16, 2017
6989da2
Delete Chapter_06#13.py
ConnerW1719 Nov 16, 2017
5c0b2ae
Delete Chapter_06#7.py
ConnerW1719 Nov 16, 2017
d15eb52
Delete Chapter_06#8.py
ConnerW1719 Nov 16, 2017
5daf7fe
Delete Chapter_06#9.py
ConnerW1719 Nov 16, 2017
e9c857a
Finished number 5 on worksheet 7
ConnerW1719 Nov 20, 2017
6929e7f
Finished numbers through 11 on worksheet 7
ConnerW1719 Nov 20, 2017
88e8d17
Finished worksheet 7, numbers 1 through 15
ConnerW1719 Nov 20, 2017
db3570f
started on lab 7, got the base code that should be on every program d…
ConnerW1719 Nov 20, 2017
06a3045
test 1 for lab 7 text adventure.
ConnerW1719 Nov 28, 2017
3334cdb
got map and direction north initailized and user input for them working.
ConnerW1719 Nov 28, 2017
c77d9c0
got all 4 directions for the user initiated.
ConnerW1719 Nov 28, 2017
d7eb91f
finished lab 7 into a working text adventure game.
ConnerW1719 Nov 28, 2017
5f9ef99
put in and fixed up the code on the front board that tells the user w…
ConnerW1719 Nov 29, 2017
e9bcc0c
finished lab 7, added code that makes the program still function as l…
ConnerW1719 Nov 29, 2017
32b8f6a
Attempting to push
ConnerW1719 Nov 30, 2017
d4d009b
Trying to push
ConnerW1719 Nov 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Lab 01 - Calculator/lab_01_part_a.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
#
#!/usr/bin/env python3
# 1.1 Part A
# Conner Walkenhorst
# 11/2/2017
"""ask the user for a temperature in Fahrenheit, then print the temperature in Celsius"""

temperature = int(input('Enter a temperature in Fehrenheit: '))
celsius = ((temperature - 32)/1.8)
print(celsius)
14 changes: 13 additions & 1 deletion Lab 01 - Calculator/lab_01_part_b.py
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
#
#!/usr/bin/env python3
# 1.2 Part B
# Conner Walkenhorst
# 11/2/2017
"""ask user for information needed to find area of trapazoid, then print area"""

print('Area of a trapezoid')
height = int(input('Enter the height of the trapezoid: '))
lenght_bottom = int(input('Enter the length of the bottom base: '))
lenght_top = int(input('Enter the length of the top base: '))
area1 = (lenght_bottom + lenght_top)
area2 = (0.5*area1*height)
print('The area is:',area2)
10 changes: 9 additions & 1 deletion Lab 01 - Calculator/lab_01_part_c.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
#
#!/usr/bin/env python3
# 1.3 Part C
# Conner Walkenhorst
# 11/3/2017
"""calculate the area of square from user input values"""

length = int(input('Length: '))
width = int(input('Width: '))
print('Area of Square: ',length*width)
42 changes: 41 additions & 1 deletion Lab 03 - Create a Quiz/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,41 @@
#
#!/usr/bin/env python3
# Lab 03 - Create a Quiz
# Conner Walkenhorst
# 11/7/2017

"""Make my own quiz from scratch"""

total = 0
print('Welcome to My Quiz')
answer1 = int(input('Question #1: What is 2+2? '))
if answer1 == 4:
total += 1
print(answer1,'is correct.')
else:
print('Sorry',answer1,'is incorrect.')
answer2 = int(input('Question #2: How many letters does the color blue have in its name? '))
if answer2 == 4:
total += 1
print(answer2,'is correct.')
else:
print('Sorry',answer2,'is incorrect.')
answer3 = input('Question #3: What is the name of the United States National Anthem? ')
if answer3 == 'The Star-Spangled Banner' or answer3 == 'the star-spangled banner' or answer3 == 'The Star Spangled Banner' or answer3 == 'the star spangled banner':
total += 1
print(answer3,'is correct.')
else:
print('Sorry',answer3,'is incorrect.')
answer4 = int(input('Question #4: How many letters does the color red have in its name? '))
if answer4 == 3:
total += 1
print(answer4,'is correct.')
else:
print('Sorry',answer4,'is incorrect.')
answer5 = input('Question #5: What is the best soda ever made? ')
if answer5 == 'Mountain Dew' or answer5 == 'mountain dew' or answer5 == 'mt. dew' or answer5 == 'mt dew':
total += 1
print(answer5,'is correct.')
else:
print('Sorry',answer5,'is incorrect.')
percentCorrect = (total/5)*100
print(str(percentCorrect) + '%')
73 changes: 72 additions & 1 deletion Lab 04 - Camel/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,72 @@
#
#!/usr/bin/env python3
# Lab 04 Camel
# Conner Walkenhorst
# 11/10/2017

"""the user is running from the natives in the great mobi desert on a stolen camel, the user decides what to do"""

from random import randint
print('Welcome to Camel!')
print('You have stolen a camel to make your way across the great Mobi desert.')
print('The natives want their camel back and are chasing you down! Survive your')
print('desert trek and out run the natives.')
done = False
milesTraveled = 0
thirst = 0
camelTiredness = 0
distanceNativesTraveled = -20
initialDrinks = 5
while done is False:
print('A. Drink from your canteen.')
print('B. Ahead moderate speed.')
print('C. Ahead full speed.')
print('D. Stop for the night.')
print('E. Status check.')
print('Q. Quit.')
userChoice = input('What will you do? ')
if userChoice.upper() == 'Q':
done = True
elif userChoice.upper() == 'E':
print('Miles traveled:',milesTraveled)
print('Drinks in canteen:',initialDrinks)
print('The natives are ',distanceNativesTraveled,'miles behind you.')
elif userChoice.upper() == 'D':
camelTiredness = 0
print('The camel is happy.')
distanceNativesTraveled += 7
elif userChoice.upper() == 'C':
milesTraveled += randint(10,20)
print('Miles Traveled:',milesTraveled)
thirst += 1
camelTiredness += randint(1,3)
distanceNativesTraveled += 7
elif userChoice.upper() == 'B':
milesTraveled += randint(5,12)
print('Miles Traveled:',milesTraveled)
thirst += 1
camelTiredness += 1
distanceNativesTraveled += randint(7,14)
elif userChoice.upper() == 'A':
if initialDrinks > 0:
initialDrinks -= 1
thirst = 0
else:
print('Error, no drinks left.')
if thirst > 4:
print('You are thirsty.')
elif thirst > 6:
print('You died of thirst.')
done = True
if camelTiredness > 5:
print('Your camel is getting tired.')
elif camelTiredness > 8:
print('Your camel is dead.')
done = True
if distanceNativesTraveled == milesTraveled:
print('The natives caught you.')
done = True
elif distanceNativesTraveled == 15 < milesTraveled:
print('The natives are getting close.')
if milesTraveled == 200:
print('You won.')
done = True
92 changes: 91 additions & 1 deletion Lab 05 - Create a Picture/main_program.py
Original file line number Diff line number Diff line change
@@ -1 +1,91 @@
#
#!/usr/bin/env python3
# Lab 03 Creat a Picture
# Conner Walkenhorst
# 11/10/2017

"""Create a picture from python code"""

import pygame

# Initialize the game engine
pygame.init()

# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
BLUE = (0, 0, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)

PI = 3.141592653

# Set the height and width of the screen
size = (500, 500)
screen = pygame.display.set_mode(size)

pygame.display.set_caption("Conner's Python House")

# Loop until the user clicks the close button.
done = False
clock = pygame.time.Clock()

# Loop as long as done == False
while not done:
for event in pygame.event.get(): # User did something
if event.type == pygame.QUIT: # If user clicked close
done = True # Flag that we are done so we exit this loop

# All drawing code happens after the for loop and but
# inside the main while not done loop.

# Clear the screen and set the screen background
screen.fill(BLACK)

# Draw a rectangle for grass
pygame.draw.rect(screen, GREEN, [0, 400, 500, 100], 0)

# Draw a rectangle for house
pygame.draw.rect(screen, BLUE, [150, 200, 200, 200], 0)

#draw a rectangle for door
pygame.draw.rect(screen, RED, [200, 400, 100, -95], 0)

#draw an ellipse for door knob
pygame.draw.ellipse(screen, BLACK, [265, 335, 15, 15], 0)

# This draws a triangle for the house using the polygon command
pygame.draw.polygon(screen, RED, [[250, 75], [150, 200], [350, 200]], 0)

# Draw an ellipse, using a rectangle as the outside boundaries
pygame.draw.ellipse(screen, BLUE, [200, 130, 100, 50], 0)

#draw an ellipse for the moon
pygame.draw.ellipse(screen, WHITE, [60, 60, 60, 60], 0)

#draw a line for upper window
pygame.draw.line(screen, BLACK, [250, 130], [250, 177], 2)

#draw other line for upper window
pygame.draw.line(screen, BLACK, [200, 150], [300, 150], 2)

# Select the font to use, size, bold, italics
font = pygame.font.SysFont('Calibri', 25, True, False)

# Render the text. "True" means anti-aliased text.
# Black is the color. This creates an image of the
# letters, but does not put it on the screen
text = font.render("Hello World", True, BLACK)

# Put the image of the text on the screen at 250x250
screen.blit(text, [200, 250])

# Go ahead and update the screen with what we've drawn.
# This MUST happen after all the other drawing commands.
pygame.display.flip()

# This limits the while loop to a max of 60 times per second.
# Leave this out and we will use all CPU we can.
clock.tick(60)

# Be IDLE friendly
pygame.quit()
18 changes: 18 additions & 0 deletions Lab 06 - Loopy Lab/part_1.py
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
#!/usr/bin/env python3
# Lab 06 Loopy Lab
# Conner Walkenhorst
# 11/15/2017

"""Lab 06 part 1"""

# Starting Value at 10
start = 10

# Do 9 times
for i in range(9):
# Loop to print digits
for j in range(i + 1):
# Prints starting variable and then adds 1 to it.
print(start, end = ' ')
start += 1
# Prints new line
print()
21 changes: 20 additions & 1 deletion Lab 06 - Loopy Lab/part_2.py
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
#
#!/usr/bin/env python3
# Lab 06 Loopy Lab
# Conner Walkenhorst
# 11/15/2017

"""Lab 06 part 2"""

#input for user to say how many o's to print
numberOs = int(input("How many o's do you want? "))
spaces = ((numberOs*2) - 2)
#loop for o's on top corresponding to user's input
for i in range(numberOs):
print('o'*2, end = '')
print()
#loop for o's on left side corresponding to user's input
for j in range(1, numberOs - 1):
print('o' + (' ' * spaces) +'o')
#loop for o's on bottom corresponding to user's input
for row in range(numberOs):
print('o'*2, end = '')
15 changes: 14 additions & 1 deletion Lab 06 - Loopy Lab/part_3.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
#
#!/usr/bin/env python3
# Lab 06 Loopy Lab
# Conner Walkenhorst
# 11/13/2017

"""Lab 06 programs"""

#Do this 10 times
for i in range(10):
#print 10 *'s on 1 line
for j in range(10):
print('*',end=' ')
#print a new line
print()
Loading