lab03

.py

School

Purdue University *

*We aren’t endorsed by this school

Course

177

Subject

Electrical Engineering

Date

Dec 6, 2023

Type

py

Pages

1

Uploaded by SuperTree11868

# -*- coding: utf-8 -*- while(True): first = input(">> First name: ") if not first.isalpha(): print(">> Assertion error: First name expected to be alphabetical but received", first) break last = input(">> Last name: ") if not last.isalpha(): print(">> Assertion error: Last name expected to be alphabetical but received", last) break year = input(">> Birth year: ") if not year.isdigit(): print(">> Assertion error: Birth year expected to be numeric but received", year) break if len(year) != 4: count = len(year) print(">> Assertion error: Expected 4 digits in year but received", count) break if len(first) > 3: fir = first[0:3].lower() elif len(first) == 1 or 2 or 3: fir = first.lower() if len(last) > 3: las = last[0:3].lower() elif len(last) == 1 or 2 or 3: las = last.lower() yea = year[2:] PUID = fir + las + yea print(">> Your PUID is", PUID) break """ Created on Tue Sep 12 12:34:49 2023 @author: Jeremiah Budd """
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help