Skip to content
Open

4 #79

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ana.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def count():
s=input("Enter length ")
p=raw_input("enter word")
f=0
flag=0
l=[]
l=[]
for i in range(s):
st=raw_input("enter the word")
l.append(st)
print l
for i in l:
for j in range(len(i)):
for f in range(len(p)):
if i[j]==p[f]:
flag+=1
if flag==len(p):
print i
flag=0
count()
14 changes: 14 additions & 0 deletions bob.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Skeleton file for the Python "Bob" exercise.
#
def hey(what):
if what[len(what)-1]=='?':
return "Sure"
elif len(str)>3:
for i in range(len(what)-1):
if what[i]=='!':
return 'Whoa, chill out!'
else:
return 'Whatever'
elif (what=='Bob'):
return 'Fine, Be that way!'
11 changes: 11 additions & 0 deletions hammer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class hammer(object):
def dna(self,str1,str2):
self.str1=str1
self.str2=str2
j=0
c=0
for i in str1:
if i!=self.str2[j]:
c+=1
j+=1
print c
19 changes: 19 additions & 0 deletions pangram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class pangram:
c=0
flag=0
def __str__(self,str):
self.str=str
self.check=self.def_pangram()
print self.check
def def_pangram(self):
for i in range(65,91):
for j in self.str:
if self.flag==0:
if (i==ord(j) or i+32==ord(j)):
self.flag+=1
self.c+=1
self.flag=0
if self.c==26:
return "True"
else:
return "False"