# lesson9_17_ear_1

# -*- coding: utf-8 -*-
"""
Examples of defs
@authors: katkaranikola stkarlos
"""

l =[]
if len(l1) == len(l2):
for i in range(0, len(l1)):
l.append(l1[i] + l2[i])
else:
print 'wrong lists'
return l

m = [1,2,3,4]
n = [2,3,4]
k = [5,5,5]
print k2

print "########################################################"

def stars(text):
x = text.find(' ')
return "initial letters of %s are: %s " %(text, text[0] + text[x+1])

a = stars('Anna Vissi')
print a

print "########################################################"

def list_str(l):
if type(l) != list:
return 'wrong input'
r = 0
for j in l:
if type(j) == str:
r = r + 1
return r

b1 = list_str(5)
print b1
b2 = list_str([1,2,'11','awe',5.6])
print b2

print "########################################################"

if len(text) % 2 == 0:
x = text[0] + text[-1]
else:
x = text[(len(text))/2]

return x

print "########################################################"

def list_rev (k):
if type(k) != list :
return 'wrong input'
n = []
#for i in range(0, len(k)):
for i in k:
#n.append(k[-1 - i])
n.append(i)
return n
y = list_rev(6)
print list_rev([3,5,'aa',1.245])

print "########################################################"

def den_milao(l):
if type(l) != list:
return 'wrong input'
k = []
for i in range(0, len(l)):
if l[i] % 2 == 0:
k.append(l[i])
count_k = len(l) - len(k)
print count_k
return k

t = den_milao( [1,4,7,10,15,19] )
print t

Posted in Uncategorized