# Two lists defining First names and Last names
l1=("Jasper", "Stone", "Amanda", "Emily")
l2=("Hooker", "Harward", "Grodman", "VonAldenbruck")
# Zip lists
list(zip(l1, l2))
# Define states_capitals
states_capitals= [("Alabama", "Montgomery"), ("Alaska", "Juneau"), ("Arizona", "Pheonix"), ("Arkansas", "Little Rock"), ("California", "Sacramento")]
# Sorting using sorted function and lambda key
sorted(states_capitals, key=lambda x: x[-1])
# Function counting length of string
def countdigits(n):
print(len(str(n)))
# Call function
countdigits(4900)
# Defining function
def figureitout(letter):
#Importing string library for specialcharacters
import string
# Defining specialcharacters variable for check
specialcharacters=set(string.punctuation)
# Respective checks for each type: Upper, Lower, Digit, and Special
if len(letter)==1:
if letter.isupper():
print(letter, "is uppercase")
if letter.islower():
print(letter, "is lowercase")
if letter.isdigit():
print(letter, "is a digit")
if any(char in specialcharacters for char in letter): # Check for specials
print("Uh Oh... Special characters detected!")
else:
print("Boop Beep... No special characters found!")
# Check if character is more than one
if len(letter)!=1:
print("Why would you disobey me...? Try again with ONE letter")
# Call function
figureitout(letter)
letter
letter
letter
letter
letter