# write a def that takes 3 arguments: a start number (int), a stop number (int) and a boolean variable, called as flag, which would take either # True value or False. Its operation would be to produce all the…

# write a def that takes 3 arguments: a start number (int), a stop number (int) and a boolean variable, called as flag, which would take either # True value or False. Its operation would be to produce all the…

Posted in Uncategorized

# -*- coding: utf-8 -*- “”” Created on Thu May 17 16:00:59 2018 @author: stkarlos “”” def list_list(r): k = [] #for i in range(0, len(r)): for i in r: s = 0 #for j in range(0, len(r[i])): for j…

Posted in Uncategorized

# -*- coding: utf-8 -*- “”” Created on Mon May 14 17:12:13 2018 @author: stkarlos “”” def ask1(n): t = [] z = [] for i in range(0,len(n)): if (n[i] % 2 == 0) : t.append(i) z.append(n[i]) return t ,…

Posted in Uncategorized

# -*- coding: utf-8 -*- “”” Created on Mon May 14 18:06:40 2018 @author: stkarlos “”” def hotel(days, cost , tax , dnt = ‘Yes’): if type(days) != int or type(cost) != float or type(tax) != int or type(dnt) !=…

Posted in Uncategorized

def ex1(x,y,z): #returns (x/y) ** z if y is not equalt to 0 k = -1 if y != 0: x = float(x) k = (x/y)**z else: print ‘Error’ return k def ex2(s,n): #returns the nth character of a given…

Posted in Uncategorized

s = 0 k = ” for i in range (9,0,-1): k = k + str(i) s = s + int(k) print ‘the last added number is ‘ , k print s vowels = ‘aeiough’ s = ” x =…

Posted in Uncategorized

x = raw_input(‘ dose password :’) while len(x)== 6 or x.count(‘!’) >= 2: print ‘ niose ligo psile mou’ x = raw_input(‘ ksana dose: ‘) print x

Posted in Uncategorized

m = [] for i in range(0, len(l1)): if (l[i] % 2 == 0) and (l[i] % 3 == 0): m.append(l[i]) print m k = [] #mesoi = [] for i in range(0, len(l1)): #mesoi.append( (l1[i] + l1[i+1]) / 2.…

Posted in Uncategorized

l1 = [] for i in range(1,31,2): l1.extend([i,i+1]) print l1 ### l2 = [] i = 1 while i <= 30: l2.append(i) i = i + 1 print l2 ### m = [] n = [] for j in range(0…

Posted in Uncategorized

l = [] flag = False while flag == False: x = raw_input(‘ dose tixaio arithmo : ‘) if x == ‘!’: flag = True else: l.append(float(x)) print l if len(l) % 2 == 0: Case = ‘even’ else: Case…

Posted in Uncategorized