Skip to content

Instantly share code, notes, and snippets.

View pzp1997's full-sized avatar

Palmer Paul pzp1997

View GitHub Profile
a = 1
b = 1
c = 1
while True:
if a**2+b**2 == c**2 and a+b>c:
print([a, b, c])
if a+b <= c:
a += 1
from time import sleep
s = 0
m = 0
h = 0
while True:
if len(str(s)) == 1:
strs = "0" + str(s)
elif len(str(s)) > 1:
## Age_Guess.py by Palmer (March 18, 2014)
## Written in Python 3.3.4
## Import statements
from random import randint
## Constants
name = "Bill"
min_age = 1
max_age = 50
import pdb
d = {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}
while True:
num = input("Input a Roman Numeral to convert it to Arabic numbers: ")
if num.lower() == "quit" or num.lower() == "q":
break
total = 0
x = 0
This file has been truncated, but you can view the full file.
Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
1
1 1
1 0 1
1 1 1 1
1 0 0 0 1
Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
1
1 1
1 1
1 1 1 1
1 1
class PascalsTriangle(object):
def __init__(self):
self.rows = [[1], [1, 1]]
def addRow(self):
row = [1]
for x in range(len(self.rows[-1])-1):
row.append(self.rows[-1][x] + self.rows[-1][x+1])
row.append(1)
self.rows.append(row)
Python 3.4.0 (v3.4.0:04f714765c13, Mar 15 2014, 23:02:41)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
1
1 1
1 1
1 1 1 1
1 1
from random import randint, choice
from time import sleep
RPi = True
try:
import RPi.GPIO as GPIO
except ImportError:
RPi = False
if RPi: