can any one help me to solve this python program?

Habibur Rahman

Write a python program that will take a String as input from the user. It will print “Found”, if 4 consecutive lowercase letters are found, otherwise “Not Found”.

[You cannot use any built in function except input(), print(), len(String), ord(String), chr(int).] Sample input 1: aFrese111 Sample output 1: Found

rodvictor

In the following script, it has been taken into account that the "ord" built-in function returns a value between 97(a) and 122(z) for lower-case letters:

def foundOrNot (string):
    consecutiveLower = 0
    
    for i in  (string):
        unicodeNumber = ord(i)
        
        if consecutiveLower == 4:
            break
            
        elif (unicodeNumber >= 97 and unicodeNumber <= 122):
            consecutiveLower += 1
            
        else:
            consecutiveLower = 0
        
    if (consecutiveLower == 4):
        print ("Found")
    else:
        print ("Not found")

testString = input()

foundOrNot(testString)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Please help me solve this basic python program

getting error while building app. can any one help me to solve this?

I want to change the result of my program from Hexadeimal to Decimal Can Any One help me?

Can anyone help me with this python program?

Can any one help me to learn reverse url in django

Can any one help me pass in data in Swift 3?

Can someone help me to solve this python challenge using while loop?

Can you please help me to solve the below python question

When am trying to create a new spot instance through python code am getting this error can any one help me out

Can you help me to solve errors in this code?

Any one help me code finish this by PySimpleGUI

Please help me to solve the problem in if statement with "and" in python

can anybody help me to correct this "argv" program?

Can you help me understanding this program?

I have ant script which works for clearcase. Can any one help me to convert it to GIT

Google map : can any one help me to set below location in my code?

i have created the wizard, i want it to position always at the center, can any one help me?

Java Concurrency - Can any one help me with the output . Why list is empty?

I am trying to analyze below query related to hierarchical and Regex can any one help me in understanding?

"BasicNetwork.performRequest: Unexpected response code 403 for in android studio " can any one help me with this error

I am getting theses errors in Django admin can any one help me this

Can any one help me desipher this error that I am getting while trying to open a port with a dll

I want to add auto slide to this script can any one help me out?

Can any one help me to decode Conditional(?) Operator in Derived Column of SSIS

Can any one help me using json data in foreach loop of php?

my yaml file raised a erorr,can any one help me out

I can't solve this error. Can someone help me?

Can you help me Many to One Relation for it?

Can some one help me with this error?

TOP Ranking

HotTag

Archive