Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

best python project

print("This is a searcher in a sentence")
print("Here you input a sentence or a phrase and then you input a word or an alphabet ")
print("And i will search it in your inputted sentence")
print(" you have give a review on our program in the end")
print("This is very useful for smart people, they always give a smart review ")
x = input("enter a sentence or a phrase")
y = input("enter a word or alphabet you want to search")

l = -1
p = y[0]
g = 0
w = -1
b = 'start'
for i in x:
    g += 1 #searched 1 letter in x or inputted phrase,
           #means 1 letter in y has been searched in all letters in x
    w+=1
    for k in x:

        l += 1


        if l  < len(x):
            n = x[l]

            if n == p:
                if l + 1 == 1:
                    j = 'st '
                elif l + 1 == 2:
                    j = 'nd '
                elif l + 1 == 3:
                    j = 'rd '
                else:
                    j = 'th '
                print(n, "is", l + 1,j, end="")
                print("letter in your given sentence", end="")
                print()
        if l + 2 > len(x):
            l = -1

            if g < len(y):
                p = y[g]
            else:
                b='end'
            break
    if b == 'end':
        break
print("-------------------------------------------------------------------------------------------------------------------------------------------------------")
print("you have gotten what you wanted from us, now it's review time")
print("Thus we are a free, review matters for us ")
print("when you will be done with giving review, we will show you average of review we have gotten till today")
print("you have options: a)good, b)excellent, c)outstanding, d)not bad, e) very bad")
q = input('choose an option: a, b, c, d, e')
if q =='a':
    print("we will hope to improve")
elif q == 'b':
    print("a very very thanks")
elif q == 'c':
    print("a very special thanks")
    print("It's our pleasure to help you ")
elif q == 'd':
    print("sorry for our mistakes")
elif q == 'e':
    print("oh oh very very sorry, we will try to improve")
z = input("type yes if you want to write a review, type no for no")
if z == 'yes':
    input("enter your review")
print("our average rating is...................")
print("b) excellent")
Source by itswachira.hashnode.dev #
 
PREVIOUS NEXT
Tagged: #python #project
ADD COMMENT
Topic
Name
3+6 =