Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python... my professor put this code up on the board... this shit doesnt work... whats wrong with it? def main(): first=input(Enter fist name) last=input(Enter last

Python... my professor put this code up on the board... this shit doesnt work... whats wrong with it?

def main(): first=input("Enter fist name") last=input("Enter last name") idnum=input("Enter ID number")

print("Your login name is") print(get_login_name(first,last,idnum))

def get_login_name(first:str,last:str,idnum:str)->str: set1=first[0:3] set2=last[0:3] set3=idnum[-3:] login_name=set1+set2+set3 return login_name #get password password=input("Enter Password") while not valid_password(password): print("password not valid") password=input("Enter Password") print("valid password")

def valid_password(password:str): '''validate password fulfill criteria''' #set boolean to false correct_length=false has_upper=fasle has_lower=flase has_digit=flase

#test for length if len(password)==7: correct_length=true for ch in passowrd: if ch.isupper(): has_uppercase=true if ch.islower(): has_lowercose=true if ch.isdigit(): has_digit=true if correct_length and has_uppercase and has_lowercase and has_digit: is_valid=true else: is_valid=false return is_valid

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

Students also viewed these Databases questions

Question

What is supply chain management?

Answered: 1 week ago