diff --git a/11111.py b/11111.py new file mode 100644 index 0000000..39467ed --- /dev/null +++ b/11111.py @@ -0,0 +1,24 @@ +a=input("") +length=len(a)//2 +middle=8 +position=8 +i=0 +j=1 +while i>") + if wish=='q': + break + else: + input=int(input("enter value")) + if input%2==0: + sum=sum+input + else: + product=product*input +print("the sum of even numbers is >>", sum) +print("the product of odd numbers is >>", product) diff --git a/armstrong.py b/armstrong.py new file mode 100644 index 0000000..0048238 --- /dev/null +++ b/armstrong.py @@ -0,0 +1,11 @@ +for i in range(999): + n=i + d=0 + s=0 + while n!=0: + d=n%10 + s=s+d*d*d + n=n/10 + if s==i: + print("The number",i," is armstrong") + diff --git a/password_genrator.py b/password_genrator.py new file mode 100644 index 0000000..e0cae76 --- /dev/null +++ b/password_genrator.py @@ -0,0 +1,13 @@ +import random +a=[] +b=[] +c=[] +for j in range (65,91): + a.append(chr(j)) +for k in range (97,122): + b.append(chr(k)) +for i in range (90,97): + c.append(chr(i)) +d=range(0,10) +password=(random.choice(a))+(random.choice(b))+(random.choice(c))+str(random.choice(d))+(random.choice(a))+(random.choice(b))+(random.choice(c))+str(random.choice(d)) +print(password) diff --git a/question2b.py b/question2b.py new file mode 100644 index 0000000..5690d80 --- /dev/null +++ b/question2b.py @@ -0,0 +1,13 @@ +n=int(input('enter a number between 5-10: ')) +l=[] +for i in range(0,n): + l.append(input()) +#for k in range(0,n): + # print(l[k]) +count=0 +for j in range(0,n): + if (l[j] == 5): + count=count+1 +print('The number 5 is',count,'times in the above list.') + + diff --git a/sghvgtnedvc.py b/sghvgtnedvc.py new file mode 100644 index 0000000..a19f7e4 --- /dev/null +++ b/sghvgtnedvc.py @@ -0,0 +1,7 @@ +############factorial###################### +a=int(input()) +fact=1 +for i in range (1,a+1): + fact=fact*i +print(fact) +###########################################