Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!