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…
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…
# -*- coding: utf-8 -*- “”” Created on Mon Apr 23 19:05:13 2018 @author: stkarlos “”” l = [5,11,22,9,7,11,10] s = 0 i = 0 while s <= 50: s = s + l[i] i = i + 1 print…
# -*- coding: utf-8 -*- “”” Created on Mon Apr 23 18:03:54 2018 @author: stkarlos “”” l = [] for i in range(1,11): l.append(i**2) print l , sum(l) # new list m = [] for i in range(0,len(l)): m.append( l[i]…
# -*- coding: utf-8 -*- “”” Created on Mon Apr 23 19:05:13 2018 @author: stkarlos “”” n = int(raw_input(‘dose arithmo: ‘)) P = 1 for i in range(1,n+1): P = P * i print P print ‘end for’ print ######…
# -*- coding: utf-8 -*- “”” Created on Mon Apr 16 18:23:58 2018 @author: 07sta “”” #compute the S = 3*4*5 + 4*5*6 + … + 23*24*25 + 1896 s = 1896 for i in range(3,24): s = s +…
# -*- coding: utf-8 -*- “”” Created on Mon Apr 16 18:23:58 2018 @author: stkarlos “”” #compute the sum S = 2^5 + 4^8 – 6^11 + 8^14 – … + 20^32 s = 2**5 j = 8 k =…
# -*- coding: utf-8 -*- “”” Created on Mon Mar 26 18:47:34 2018 @author: stkarlos “”” x = raw_input(” dose 8psifio kodiko: “) if len(x) != 8: print ‘dose ksana’ elif x[0] != x[-1] or x.count(‘a’) != x.count(‘!’): print ‘lathos…
# -*- coding: utf-8 -*- “”” Use of casting theory @authors: stkarlos “”” a = float(raw_input(‘dose to a: ‘)) b = float(raw_input(‘dose to b: ‘)) c = float(raw_input(‘dose to c: ‘)) if (a >= b) and (a >= c): M…
# -*- coding: utf-8 -*- “”” Created on Thu Mar 29 16:18:18 2018 @author: stkarlos “”” a = ‘ARTERTaabntrur’ #metrame sinoliko plithos a and A print a.count(‘a’) + a.count(‘A’) #combinatory print (a.upper()).count(‘A’) #safe way print a.lower().count(‘a’) #directly
# -*- coding: utf-8 -*- “”” Sibliroste tis grammes 15 eos 19 etsi oste stin print tis grammis 22 na emfanizontai oi theseis olon ton a @authors: stkarlos “”” #paradeigma xrisis tis print me ta % z = 5 print…