This file contains 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
update promotion | |
set enddate = '2013-11-17' | |
where OFFERTYPE = '3FOR1' and | |
OFFERGROUP= 'ALLTESTERSGDB' and | |
site = 'EUKDLX' |
This file contains 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
my_file = open("output.txt", "r") | |
print my_file.read() | |
my_file.close() |
This file contains 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
my_list = [i**2 for i in range(1,11)] | |
f = open("output.txt", "w") | |
for item in my_list: | |
f.write(str(item) + "\n") | |
f.close() |
This file contains 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
class Employee(object): | |
"""Models real-life employees!""" | |
def __init__(self, employee_name): | |
self.employee_name = employee_name | |
def calculate_wage(self, hours): | |
self.hours = hours | |
return hours * 20.00 | |
# Add your code below! |
This file contains 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
class Animal(object): | |
is_alive = True | |
def __init__(self, name, age): | |
self.name = name | |
self.age = age | |
def description(self): | |
print self.name | |
print self.age | |
hippo = Animal("Jeffrey", 2) |
This file contains 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
class Animal(object): | |
def __init__(self, name): | |
self.name = name | |
zebra = Animal("Jeffrey") | |
print zebra.name |
This file contains 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
garbled = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI" | |
message = filter(lambda x: x!="X" ,garbled[::-1]) | |
This file contains 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
languages = ["HTML", "JavaScript", "Python", "Ruby"] | |
#print python only | |
print filter(lambda x: x=="Python" ,languages) |
This file contains 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
my_list = range(1, 11) | |
# Add your code below! | |
backwards= my_list[::-1] | |
print backwards |
This file contains 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
my_list = range(1, 11) # List of numbers 1 - 10 | |
#Every odd number | |
print my_list[::2] |
NewerOlder