Skip to content
24 changes: 24 additions & 0 deletions 11111.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
a=input("")
length=len(a)//2
middle=8
position=8
i=0
j=1
while i<length+2:
if i==0 or i==length+1:
print("#"*19)
else:

while j<len(a)+1:
if a[j-1]=="u":
print("#"+" "*(position+int(a[j]))+"*"+" "*(17-position-int(a[j])-1)+"#")
position=position+int(a[j])

elif a[j-1]=="d":
print("#"+" "*(position-int(a[j]))+"*"+" "*(17-position+int(a[j])-1)+"#")
position=position-int(a[j])+1
j=j+2
break

i=i+1

16 changes: 16 additions & 0 deletions QUESTION.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
input=0
wish='B'
product=1
sum=0
while wish!='q':
wish=input("enter q to quit or any other key to continue>>")
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)
11 changes: 11 additions & 0 deletions armstrong.py
Original file line number Diff line number Diff line change
@@ -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")

13 changes: 13 additions & 0 deletions password_genrator.py
Original file line number Diff line number Diff line change
@@ -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)
13 changes: 13 additions & 0 deletions question2b.py
Original file line number Diff line number Diff line change
@@ -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.')


7 changes: 7 additions & 0 deletions sghvgtnedvc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
############factorial######################
a=int(input())
fact=1
for i in range (1,a+1):
fact=fact*i
print(fact)
###########################################