Created
December 9, 2016 20:19
-
-
Save MohammadaliMirhamed/059ee4f3d25641bfb2897ce77593ba0d to your computer and use it in GitHub Desktop.
Q1= yek adad begire va az 0 ta on adad , adade zoje beyensh ro be sourt list neshon bede
Q2=listy ke az tamrin bala besd omadeh ro mojmooesh ro chup kone
Q3=added bedast amadeh az tamrin bala tadad arghamsh ra chup konid khoroje Q1 ba farze vorody 10
A1=[0,2,4,6,8]
A2=20
A3=2
This file contains hidden or 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
''' | |
Q1= yek adad begire va az 0 ta on adad , adade zoje beyensh ro be sourt list neshon bede | |
Q2=listy ke az tamrin bala besd omadeh ro mojmooesh ro chup kone | |
Q3=added bedast amadeh az tamrin bala tadad arghamsh ra chup konid | |
khoroje Q1 ba farze vorody 10 | |
A1=[0,2,4,6,8] | |
A2=20 | |
A3=2 | |
''' | |
def Even_num(Innumber): | |
list=[];counter=0 | |
while counter<Innumber: | |
if counter%2==0: | |
list.append(counter) | |
counter+=1 | |
return list | |
#------------------------------------- | |
def SumOfListNums(list): | |
count=0;sum=0 | |
while count<len(list): | |
sum+=list[count] | |
count+=1 | |
return sum | |
#-------------------------------------- | |
def DigitSum(number): | |
return len(str(number)) | |
n=100 | |
print Even_num(n) | |
print SumOfListNums(Even_num(n)) | |
print DigitSum(SumOfListNums(Even_num(n))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment