0% found this document useful (0 votes)
11 views

code2pdf_678a16a88ded9

Phyton code

Uploaded by

podcastwithamit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

code2pdf_678a16a88ded9

Phyton code

Uploaded by

podcastwithamit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

##line=input("enter string:")

##count=len(line)
##u=0
##l=0
##d=0
##space=0
##s=0
##for a in line:
## if a.isupper():
## u+=1
## elif a.islower():
## l+=1
## elif a.isdigit():
## d+=1
## elif a.isspace():
## space+=1
## else:
## s+=1
##print("Number of uppercase letters:",u)
##print("Number of lowercase letters:",l)
##print("number of alphabets:",l+u)
##print("Number of digits:",d)
##print("Numbers of space:",space)
##print("Number of special characters:",s)
##print("total strength:",count)
##
##
##L=[]
##ch='y'
##while ch=='y' or ch=='Y':
## a=int(input("enter your value:"))
## L.append(a)
## ch=input("Do you want to continue?(y/n)")
##print(L)
##print("Maximum value",max(L))
##print("minimun value",min(L))

##n=int(input("Enter a number:"))
##if n%10==7 or n%7==0:
## print(n,"is a buzz number")
##else:
## print(n,"is not buzz number")

##pronic no
##n=int(input("Enter a number:"))
##f=0
##for i in range(n):
## if i*(i+1)==n:
## f=1
## break
##if f==1:
## print(n,"is pronic number")
##else:
## print(n,"is not pronic number")

##perfect no
##n=int(input("Enter value:"))
##i=1
##s=0
##while i<n:
## if n%i==0:
## s=s+i
## i=i+1
##if n==s:
## print(n,"is perfect number",s)
##else:
## print(n,"is not perfect number",s)

##reverse for string


##rev=''
##s=input("enter string")
##for i in range(len(s)-1,-1,-1):
## rev=rev+s[i]
##print(s,rev)

##palindrome for string


##rev=''
##s=input("Enter string")
##for i in range(len(s)-1,-1,-1):
## rev=rev+s[i]
##if s==rev:
## print("palindrome")
##else:
## print("not palindrome")

##no=int(input("enter your no"))


##if no%7==0 or no%10==7:
## print(no," is buzz no")
##else:
## print(no,"is not buzz no")

##ori=int(input("Enter no"))
##temp=ori
##rev=0
##while temp>0:
## digits=temp%10
## temp=temp//10
## rev=rev+(digits**3)
##if ori==rev:
## print(ori,"is an armstrong",rev)
##else:
## print(ori,"is not an armstrong",rev)

##n=int(input("Enter your no"))


##for i in range(n):
## for a in range(i):
## print(end=" ")
## for j in range(n-i):
## print(j+1,end=" ")
## print()

##n=int(input("Enter no"))
##for i in range(n):
## for k in range(i):
## print(end=" ")
## for j in range(n-1):
## print(j+1,end=" ")
## print()
##

##while True:
## print("This will print forever")
##t1=tuple()
##print(t1)

##t2=(15,)
##print(t2)

##t3=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
##print(t3)

##t4=tuple('hello')
##print(t4)

##t5=tuple(input("enter element for tuple:"))


##print(t5)

##tuple=eval(input("enter element for eval:"))


##print(tuple)

##def f():
## t=(10,20,30,40,50,60,70,80,90,100)
## i=int(input("enter index:"))
## return t[i]
##print(f())

##t=('p','y','h','t','o','n')
##length=len(t)
##for i in range(length):
## print('At index',i,'and',i-length,'element:',t[i])
##

##t=(10,20,30.40,50,60,70,80,90,100,'*')
##T=('A','B','C','D','E','@','#')
####print(t+T)
##print(t==T)

##T1=(1,2,'A','B')
##w,x,y,z=T1
##print(w)
##print(z)
##print(y)
##print(x)
##

##T2=(1,2,'A','B')
####print(T2)
##del T2

##T1('p','y','h','t','o','n')
##for i in range(len(T1
## print(T1[i])

##T1=(1,2,'A','B')
##print(1 in T1)
##print('A' not in T1)

##t=(10,20,30,40,50,60,70,80,90,100)
##T=('E','B','C','D','A')
##print(len(t))
##print(max(T))
##print(min(t))
##print(t.index(20))
##print(t.count(40))
##print(sum(t))
##print(sorted(t))

##a=(10,20,30,40,50,60,70,80,90,100)
##print(a[3:-3])
##print(a[3:15])
##print(a[-15:7])

##t=tuple()
##ch='Y'
##while ch.upper()=='Y':
## name=input("enter your name:")
## rno=int(input("enter your roll no:"))
## t=t+(name,rno)
## ch=input("Do you want to continue ? (y/n)")
##print(t)

##a=tuple()
##t=tuple()
##ch='Y'
##name=input("enter your name:")
##rno=int(input("enter your roll no:"))
##while ch.upper()=='Y':
## subject=input("enter your subject")
## marks=int(input("enter your marks"))
## a=a+(name,rno)
## t=t+(subject,marks)
## ch=input("Do you want to continue ? (y/n)")
##print(a)
##print(t)

##print("List is a collection which is ordered and changeable allow duplicaste members")


##print()
##print("tuple is a collection which is ordered and umchangeable allow duplicaste members")
##print()

##dict={'Name':'Abc','age':15,'class':'11th'}
##print(dict)
##print("dict['Age']:",dict['Age'])
##dict['Age']=16
##print(dict)

##dict={'name':'amit', 'age':15,'class':'11th','name':'aman'}
##print(dict)
##print(len(dict))
##print(type(dict))
##x=dict.get("Age")
##print(x)
##x=dict.keys()
##print(x)
##x=dict.values()
##print(x)
##x=dict.items()
##print(x)
##dict.popitem()
##print(dict)

##
##dict={'Name':'Abc','Age':15,'Class':'11th'}
####for x in dict:
#### print(x)
####for x in dict:
#### print(dict[x])
##mydict=dict.copy()
##print(mydict)

##myClass={
## "s1":{
## "Name":"Abc",
## "Age":20
## },
## "s2":{
## "Name":"pqr",
## "Age":18
## },
## "s3":{
## "Name":"lmn",
## "Age":20
## }
##}
##print(myClass)

##myClass={
## "s1":{"Name":"Abc","Age":20},
## "s2":{"Name":"pqr","Age":18},
## "s3":{"Name":"lmn", "Age":20}
##}
##print(myClass)
##

##t1=tuple()
##print(t1)
##
##t2=(15,)
##print(t2)
##
##t3=(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
##print(t3)
##
##t4=tuple('hello')
##print(t4)
##
##t5=tuple(input("enter element for tuple:"))
##print(t5)
##
##tuple=eval(input("enter element for eval:"))
##print(tuple)
##
##def f():
## t=(10,20,30,40,50,60,70,80,90,100)
## i=int(input("enter index:"))
## return t[i]
##print(f())

##n=int(input("How many students:"))


##winlist={}
##for i in range(n):
## k=input("Name of student:")
## v=int(input("Number of competitions won:"))
## winlist[k]=v
##rev_dict={v:k for k, v in winlist.items()}
##print(winlist)
##print(rev_dict)

##n=int(input("How many students:"))


##winlist={}
##for i in range(n):
## k=input("Name of student:")
## v=int(input("Number of competitions won:"))
## winlist[k]=v
##rev_dict={v:k for k, v in winlist.items()}
##print(winlist)
##print(rev_dict)

##j=[]
##k=[]
##ch='y'
##while ch=='y' or ch=='y':
## L=eval(input("Enter first list here:"))
## m=eval(input("Enter second list here:"))
## l1=len(L)
## l2=len(m)
## if l1==12:
## for j in range(0,l1):
## j.append(L[i]+m[i])
## k.append(L[i]*m[i])
## print("ADD=",j)
## print("PROD=-",k)
## else:
## print("sorry!!!",l1,"is not equal to ",l2)
## choice=input('do you want to continue:')
##
##L=[]
##ch='Y'
##while ch=='y' or ch=='Y':
## name=input("enter your Employee name:")
## sal=int(input("enter your salary"))
## HRA=sal*20/100
## MA=sal*15/100
## DA=sal*25/100
## PF=sal*12.5/100
#### GS=(sal+HRA+DA+MA)
#### netsalary=GS-PF
######print("HRA=",HRA)
######print("MA=",MA)
######print("DA=",DA)
######print("PF=",PF)
######print("GS =",GS)
#### ##print("netsalary=",netsalary)
#### x=[name,sal,HRA,MA,DA,PF,GS,netsalary]
#### L.append(x)
#### print(x)
#### ch=input("Do you want to continue ?"(y/n))
##
##L=[]
##print("1.Square")
##print("2.Rectangle")
##print("3.Tringle")
##print("4.Circle")
##Ch="Y"
##while Ch=="y" or Ch=="Y":
## n=int(input("Enter your Choice:"))
## if n==1:
## S=int(input("Enter your side"))
## print("Area of Square =",S*S)
## print("perimeter of Square =",4*S)
## if n==2:
## l=int(input("Enter your length"))
## b=int(input("Enter your breath"))
## print("Area of rectangle =",l*b,)
## print("perimeter of rectangle =",2*(l+b),)
## if n==3:
## c=int(input("Enter your base"))
## h=int(input("Enter youe hieght"))
## r=int(input("Enter Hypotenuse"))
## z=1/2*(c*h)
## print("Area = ",z)
## print("Perimeter of Tringle=",c+h+r)
##ch=input("Do you want to continue ?"(y/n))
##

##for i in range(0,5):
## for j in range(0,i+1):
## print(j,end=" ")
## print()

##for l in range(5,0,-1):
## for k in range(5,l=):
## print(k,end=" ")
## print():

##n=int(input("Enter your no:"))


##if n%10==7 or n%7==0:
## print(n,"Is buzz no")
##else:
## print(n,"is not buzz no")
##
##ori=int(input("Enter no"))
##temp=ori
##rev=0
##while temp>0:
## digits=temp%10
## temp=temp//10
## rev=rev+(digits**3)
##if ori==rev:
## print(ori,"is an armstrong",rev)
##else:
## print(ori,"is not an armstrong",rev)

##r=''
##s=input("enter your string")
##for c in range(len(s)-1,-1,-1):
## r=r+s[c]

##print(s,r)
##if s==r:
## print("palindrome")
##else:
## print("not palindrome")

##l1 = []
##l2 =[]
##l3 = []
##print("1.Rectangle:")
##print("2.square:")
##print("3. circle:")
##ch = 'y'
##while ch=='y' or ch=='Y':
## choice = int(input("Enter your choice:"))
## if choice ==1:
## l=int(input("Enter length value:"))
## b=int(input("Enter breadth value:"))
## a=("area of rectangle:", l*b)
## b=("perimeter of rectangle:", 2*(l+b))
## c=(a,b)
## l1.append(c)
## print(l1)

##def sum():
## x=5
## y=10
## print(x,'+',y,'=',x+y)
##def sub():
## x=5
## y=10
## print(x,'-',y,'=',x-y)
##def mul():
## x=5
## y=10
## print(x,'*',y,'=',x*y)
##def div():
## x=5
## y=10
## print(x,'/',y,'=',x/y)
##def flot():
## x=5
## y=10
## print(x,'//',y,'=',x//y)
##def modlu():
## x=5
## y=10
## print(x,'%',y,'=',x%y)
##def choice():
## print("1.Addition")
## print("2.Substraction")
## print("3.Multiply")
## print("4.Division")
## print("5.Float Division")
## print("6.Modulus")
##ch='y'
##while ch=='y' or ch=='Y':
## choice()
## n=int(input("Enter Your Choice"))
## if n==1:
## add()
## elif n==2:
## sub()
## elif n==3:
## mul()
## elif n==4:
## div()
## elif n==5:
## flot()
## elif n==6:
## modlu()
## else:
## print("not found")
## ch=input("Do you Want To Continue(y/n)")
## print()
##

##def sum():
## x=5
## y=10
## print(x,'+',y,'=',x+y)
##def sub():
## x=5
## y=10
## print(x,'-',y,'=',x-y)
##def mul():
## x=5
## y=10
## print(x,'*',y,'=',x*y)
##def div():
## x=5
## y=10
## print(x,'/',y,'=',x/y)
##def flot():
## x=5
## y=10
## print(x,'//',y,'=',x//y)
##def modlu():
## x=5
## y=10
## print(x,'%',y,'=',x%y)
##def choice():
## print("1.Addition\n2.Substraction\n3.Multiply\n4.Division\n5.Float Division\n6.Modulus")
##ch='y'
##while ch=='y' or ch=='Y':
## choice()
## n=int(input("Enter Your Choice"))
## if n==1:
## add()
## elif n==2:
## sub()
## elif n==3:
## mul()
## elif n==4:
## div()
## elif n==5:
## flot()
## elif n==6:
## modlu()
## else:
## print("not found")
## ch=input("Do you Want To Continue(y/n)")
## print()
##
##
##import random
##myNumber=random.randint(0,4)
##COLOR=["Yellow","WHITE","BLACK","RED"]
##for i in range(0,myNumber):
## print(COLOR[i],end="*")
## print()
##
##

##import random
##a="wisdom"
##b=random.randint(1,6)
##for i in range(0,b,2):
## print(a[i],end='#')
##import random
##signal=['red','yellow','green']
##for i in range(2,0,-1):
## R=random.randrange(i)
## print(signal[R],end='#')
##

##import random
##m=[5,10,15,20,25]
##for i in range(1,3):
## first=random.randint(2,5)-1
## sec=random.randint(3,6)-2
## third=random.randint(1,4)
##

##p=5
##def sum(q,r=2):
## global p
## p=r+q**2
## p=r+q**2
## print(p, end='#')
##a=10
##b=5
##sum(a,b)
##sum(r=5,q=1)

##def callon(b=20,a=10):
## b=b+a
## a=b-a
## print(b,"#",a)
## return b
##x=100
##y=200
##x=callon(x,y)
##print(x,"@",y)
##y=callon(y)
##print(x,"@",y)

s="Racecer Car Radar"


n=len(S)

You might also like