Skip to content

Instantly share code, notes, and snippets.

#ideas+, choice = raw_input(), if choice == "what ever input"
print """
******************************
* Austin's Python experience *
******************************
Hello please type the name of the lesson you want
ex. one, two, three."""
data = (raw_input())
@akreer135
akreer135 / strings.py
Created September 23, 2013 20:11
The lesson on strings and text
x = "There are %d types of people." % 10
binary = "binary"
do_not = "don't"
y = "Those who know %s and those who %s." % (binary, do_not)
print x
print y
print "I said: %r." % x
print "I also said: '%s'." % y
@akreer135
akreer135 / printing printing printing.py
Created September 23, 2013 20:26
about printing and more.
# Here's some new strange stuff, remember type it exactly.
days = "Mon Tue Wed Thu Fri Sat Sun"
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"
print "Here are the days: ", days
print "Here are the months: ", months
print """
There's something going on here.
persian_cat = "I'm split\non a line."
backslash_cat = "I'm \\ a \\ cat."
fat_cat = """
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""
@akreer135
akreer135 / askingquestions.py
Created September 25, 2013 23:25
asking questions and raw input.
print "How old are you?",
age = raw_input()
print "How tall are you?",
height = raw_input()
print "How much do you weigh?",
weight = raw_input()
print "So, you're %r old, %r tall and %r heavy." % (
age, height, weight)
@akreer135
akreer135 / part 2.py
Last active December 23, 2015 23:09
questions and raw input part 2
age = raw_input("How old are you? ")
height = raw_input("How tall are you? ")
weight = raw_input("How much do you weigh? ")
print "So, you're %r old, %r tall and %r heavy." % (age, height, weight)
@akreer135
akreer135 / argv.py
Created September 25, 2013 23:49
argv and variables
from sys import argv
script, first, second, third = argv
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
@akreer135
akreer135 / cacl1.py
Created September 29, 2013 02:45
calculators...
print "Hello welcome to Austin's calculator. Would you like to use (b)asic functions or more (c)omplex functions?"
dec = (raw_input())
if dec == "b":
print """(m)ultiply, (d)ivide, (a)dd, or (s)ubtract?. Don't forget,
this can only be integers or whole numbers."""
answer = (raw_input())
if answer == "m": #Multiplication
print "Welcome to Austin's calculator, please type your equation. ex. 2+4"
calc = input(); print calc
@akreer135
akreer135 / functions.py
Created October 21, 2013 16:49
first functions
# this one is like your scripts with argv
def print_two(*args):
arg1, arg2 = args
print "arg1: %r, arg2: %r" % (arg1, arg2)
# ok, that *args is actually pointless, we can just do this
def print_two_again(arg1, arg2):
print "arg1: %r, arg2: %r" % (arg1, arg2)
# this just takes one argument