Question

In: Computer Science

I'm making a python program that checks the users input. If the users input does not...

I'm making a python program that checks the users input. If the users input does not match the rules then the program will output "No".

If the users input does match the rules it will output "Yes".

The rules are :

at least 5 uppercase letters

at least 5 lowercase letters

at least 5 numbers

No more than 20 characters in total

I have managed to meet these conditions in individual python files but not in one. Ideally without importing anything, still learning the basics as you can see! Thanks

Solutions

Expert Solution

Python 3 code

============================================================================================

s=input('Enter input: ')

length=len(s)
flag=0
countlower=0
countupper=0
countdigit=0

if length<=20:
for i in s:
if(i.islower()):
countlower=countlower+1
elif(i.isupper()):
countupper=countupper+1
elif(i.isdigit()):
countdigit=countdigit+1

if(countlower<5 or countupper<5 or countdigit<5):
flag=0
else:
flag=1

else:
flag=0


if flag==0:
print('No')
else:
print('Yes')

============================================================================================

Output


Related Solutions

I'm making a python program that checks the users input. If the users input does not...
I'm making a python program that checks the users input. If the users input does not match the rules then the program will output "No". If the users input does match the rules it will output "Yes". The rules are : 5 uppercase letters 5 lowercase letters 5 numbers First letter must be capitilized The total characters must be 15 I have managed to meet these conditions in individual python files but not in one. Ideally without importing anything, still...
PYTHON Write a program that accepts a range of input from the user and checks whether...
PYTHON Write a program that accepts a range of input from the user and checks whether the input data is sorted or not. If the data series is already sorted your program should print “True” or should print “False” otherwise. You should not use any sort function for this program. Input: How many numbers you want to input: 3 # user input 3 Input the number: 5 Input the number: 2 Input the number: 7 Output: False
Making a program in Python with the following code types. I'm very confused and would love...
Making a program in Python with the following code types. I'm very confused and would love the actual code that creates this prompt and a brief explanation. Thanks! A comment on the top line of your program containing your name. A comment on the second line containing your section number. A comment on the third line containing the date. A comment on the fourth line containing your email address. A comment with the lab number and purpose of this lab....
PYTHON Write a python program that encrypts and decrypts the user input. Note – Your input...
PYTHON Write a python program that encrypts and decrypts the user input. Note – Your input should be only lowercase characters with no spaces. Your program should have a secret distance given by the user that will be used for encryption/decryption. Each character of the user’s input should be offset by the distance value given by the user For Encryption Process: Take the string and reverse the string. Encrypt the reverse string with each character replaced with distance value (x)...
I'm working on a to-do list program in Python 2. I'm trying to delete an item...
I'm working on a to-do list program in Python 2. I'm trying to delete an item from the list and I'm not sure what I'm missing to do that. I haven't been able to get it to delete by string or by index number. Also, I'm trying to get the menu to run again after the user completes the add/delete/etc options. Do I need to put menu() menu_option = int(input("Welcome to your To-Do List. Please choose and option to continue:...
Create a program that ask to input two users and the result will vary on their...
Create a program that ask to input two users and the result will vary on their name with similar digits. In a game of F.L.A.M.E.S , it will count and repeat depends on their name that has a similar digit. For an Example (JOE RIZAL) and (JACKLYN BRACKEN) - JOE RIZAL has - 5 similar digits , while JACKLYN BRACKEN has 6 similar digits so a total of 11. F - Friends - 1,7 L - Lover - 2,8 A...
Write a program in python that corrects misspelled words. The input for the program is either...
Write a program in python that corrects misspelled words. The input for the program is either a string or a list of strings. The output should be a string or a list depending on the input and should have the spellings corrected. The speller should be able to correct at least the words listed below. You are free to use any data structures we have covered so far including lists and dictionaries. Your program should be in autocorrect.py. Here is...
Python Coding 1. validate_username_password(username, password, users): This function checks if a given username and password matches...
Python Coding 1. validate_username_password(username, password, users): This function checks if a given username and password matches in the stored users dictionary. This function returns True if a match found otherwise returns False. 2. validate_existing_user(users): This function asks for username and password and checks if user provided name and password matches. It prints an informational message and returns username if it does find a match. Call validate_username_password() function to perform this validation. A user has total of three chances to validate....
I'm working on python code which is substring matching. For example, the given string is input...
I'm working on python code which is substring matching. For example, the given string is input "CTTGTGATCTCGTGTCGTGGGTAG", and a substring we want to find in the main one is "GTGG". So the code will print out the position and the substrings in the main which has exactly one different position. For example, start at position 4 the substring is GTGA since there is only one letter different, and so on. Even though we know that string index starts at 0,...
(CODE IN PYTHON) Program Input: Your program will display a welcome message to the user and...
(CODE IN PYTHON) Program Input: Your program will display a welcome message to the user and a menu of options for the user to choose from. Welcome to the Email Analyzer program. Please choose from the following options: Upload text data Find by Receiver Download statistics Exit the program Program Options Option 1: Upload Text Data If the user chooses this option, the program will Prompt the user for the file that contains the data. Read in the records in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT