<filename>tasks.py<gh_stars>0
seconds_per_hour = 60 * 60
seconds_per_day = 24
seconds_per_hour = seconds_per_hour * seconds_per_day
sen = seconds_per_hour / seconds_per_day
san = seconds_per_hour // seconds_per_day
print(seconds_per_hour)
print(sen)
print(san)

years_list = [2004, 2005, 2006, 2007, 2008]
print(years_list[2], years_list[4])

things = ["mozzarella", "cinderella", "salmonella"]
things1=things[1].capitalize(), things[0].upper()
print(things)
del things[2]
print(things1)

surprise = ['Groucho', 'Chinco', 'Harpo']
surprise[-1] = surprise[-1].lower()
surprise[-1] = surprise[-1][::-1]
surprise[-1].capitalize()
print(surprise)
print(surprise[-1])

e2f = {'dog': 'chien', 'cat': 'chat', 'walrus': 'morse'}
print(e2f['walrus'])
f2e = {}
for english, frechen in e2f.items():
	f2e[frechen] = english
print(f2e)
print(f2e['chien'])
print(list(e2f.keys()))

life = {
    'animals': {
        'cats': [
            'Henri', 'Grumpy', 'Lucy'
            ],
        'octopi': {},
        'emus': {}
        },
    'plants': {},
    'other': {}
    }
print(life.keys(), list(life.keys()))
print(life['animals']['cats'], life['animals'].keys())

guess_me1 = 7
if guess_me1 < 7:
    print("too low")
elif guess_me1 > 7:
    print('too high')
else:
    print('just right')
    
guess_me2 = 7
start = 1
while True:
    if start < guess_me2:
        print('too low')
    elif start == guess_me2:
        print('found it!')
        break
    elif start > guess_me2:
        print('oops')
        break
    start+=1
    
for yuy in [3, 2, 1, 0]:
	print(yuy)
	
wolf = [isaac for isaac in range(10) if isaac % 2 == 0]
print(wolf)

squares = {snub: snub*snub for snub in range(10)}
print(squares)

odd = {number for number in range(10) if number % 2 == 1}
print(odd)

for smolk in ('Got: %s' % sas for sas in range(10)):
	print(smolk)
	
def good():
	return ['Harry', 'Ron', 'Hermione']
print(good())

def get_odds():
		for kol in range(1, 10, 2):
			yield kol
for hol, kol in enumerate(get_odds(), 1):
	if hol == 3:
		print(kol)
		break
		
def Test(func):
	def new_func(*args, **kwargs):
		print('start')
		result = func(*args, **kwargs)
		print('end')
		return result
	return new_func
@Test
def gerni():
	print('Geg HuH')
print(gerni())

titles = ['Creature of Habit', 'Crewel Fate']
plots = ['A nun turns into a monster', 'A haunted yarn shop']
movies = dict(zip(titles, plots))
print(movies)

from zoo import hours
print(hours())

from collections import OrderedDict
fancy = OrderedDict([('a', 1), ('b', 2), ('c', 3)])
print(fancy)

from collections import defaultdict
dict_of_lists = defaultdict(list)
dict_of_lists['a'].append('something for a')
print(dict_of_lists['a'])

class Thing():
    def __init__(self, name):
        self.name = name
thing = Thing("Hai")
print(thing.name)

input()
<filename>tasks.py<gh_stars>0
seconds_per_hour = 60 * 60
seconds_per_day = 24
seconds_per_hour = seconds_per_hour * seconds_per_day
sen = seconds_per_hour / seconds_per_day
san = seconds_per_hour // seconds_per_day
print(seconds_per_hour)
print(sen)
print(san)

years_list = [2004, 2005, 2006, 2007, 2008]
print(years_list[2], years_list[4])

things = ["mozzarella", "cinderella", "salmonella"]
things1=things[1].capitalize(), things[0].upper()
print(things)
del things[2]
print(things1)

surprise = ['Groucho', 'Chinco', 'Harpo']
surprise[-1] = surprise[-1].lower()
surprise[-1] = surprise[-1][::-1]
surprise[-1].capitalize()
print(surprise)
print(surprise[-1])

e2f = {'dog': 'chien', 'cat': 'chat', 'walrus': 'morse'}
print(e2f['walrus'])
f2e = {}
for english, frechen in e2f.items():
	f2e[frechen] = english
print(f2e)
print(f2e['chien'])
print(list(e2f.keys()))

life = {
    'animals': {
        'cats': [
            'Henri', 'Grumpy', 'Lucy'
            ],
        'octopi': {},
        'emus': {}
        },
    'plants': {},
    'other': {}
    }
print(life.keys(), list(life.keys()))
print(life['animals']['cats'], life['animals'].keys())

guess_me1 = 7
if guess_me1 < 7:
    print("too low")
elif guess_me1 > 7:
    print('too high')
else:
    print('just right')
    
guess_me2 = 7
start = 1
while True:
    if start < guess_me2:
        print('too low')
    elif start == guess_me2:
        print('found it!')
        break
    elif start > guess_me2:
        print('oops')
        break
    start+=1
    
for yuy in [3, 2, 1, 0]:
	print(yuy)
	
wolf = [isaac for isaac in range(10) if isaac % 2 == 0]
print(wolf)

squares = {snub: snub*snub for snub in range(10)}
print(squares)

odd = {number for number in range(10) if number % 2 == 1}
print(odd)

for smolk in ('Got: %s' % sas for sas in range(10)):
	print(smolk)
	
def good():
	return ['Harry', 'Ron', 'Hermione']
print(good())

def get_odds():
		for kol in range(1, 10, 2):
			yield kol
for hol, kol in enumerate(get_odds(), 1):
	if hol == 3:
		print(kol)
		break
		
def Test(func):
	def new_func(*args, **kwargs):
		print('start')
		result = func(*args, **kwargs)
		print('end')
		return result
	return new_func
@Test
def gerni():
	print('Geg HuH')
print(gerni())

titles = ['Creature of Habit', 'Crewel Fate']
plots = ['A nun turns into a monster', 'A haunted yarn shop']
movies = dict(zip(titles, plots))
print(movies)

from zoo import hours
print(hours())

from collections import OrderedDict
fancy = OrderedDict([('a', 1), ('b', 2), ('c', 3)])
print(fancy)

from collections import defaultdict
dict_of_lists = defaultdict(list)
dict_of_lists['a'].append('something for a')
print(dict_of_lists['a'])

class Thing():
    def __init__(self, name):
        self.name = name
thing = Thing("Hai")
print(thing.name)

input()