#10-1###################################################
"""Write a program that uses list and range to create
the list [3,6, 9, . . . , 99]."""

##list1 = []
##for i in range(3,100,3):
##    list1.append(i)
##print(list1)


#10-2####################################################
"""Write a program that asks the user for a weight in
kilograms. The program should convert the weight to
kilograms (should be pounds), formatting the result to
one decimal place."""

##weightKG = int(input("Enter your weight in kilograms: "))
##weightLBS = weightKG*2.2
##print("Your weight in pounds =",f"{weightLBS:.1f}")
            


#10-3######################################################
"""Write a program that asks the user to enter a word.
Rearrange all the letters of the word in alphabetical order
and print out the resulting word. For example, abracadabra
should become aaaaabbcdrr. """

##word1 = input("Enter a word: ")
###word1Sorted = ''.join(sorted(word1))
##word1Sorted = sorted(word1)
##print("Your word sorted is ",*word1Sorted,sep="")        

#10-4######################################################
"""Write a program that takes a list of ten prices and
ten products, applies an 11% discount to each of the
prices displays the output like below, right-justified
and nicely formatted.
Apples    $  2.45
Oranges   $ 18.02
...
Pears     $120.03"""

##productList = ["Apples","Oranges","Pears","Bananas","Grapes","Lemons","Mangos","Raisins","Plums","Kiwis"]
##priceList = [2.78,20.48,10.99,11.99,12.99,13.99,14.99,15.99,16.99,136.40]
##for i in range(10):
##    print(f"{productList[i]:<10}  {priceList[i]*0.88:>10.2f}")



#10-5######################################################
"""Use the following two lists and the format method to
create a list of card names in the format card value of
suit name (for example, 'Two of Clubs').
suits = ['Hearts', 'Diamonds', 'Clubs', 'Spades']
values = ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven',
'Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace']"""
# error: remove "One" from values list

##suits = ['Hearts', 'Diamonds', 'Clubs', 'Spades']
##values = ['Two', 'Three', 'Four', 'Five', 'Six', 'Seven','Eight', 'Nine', 'Ten', 'Jack', 'Queen', 'King', 'Ace']
##cardNames = []
##for i in range(13):
##    for j in range(4):
##        cardName = str(values[i]) + " of " + str(suits[j])
##        cardNames.append(cardName) 
##        
##print("cardNames = ",*cardNames,sep="\n")


#10-6######################################################
"""Write a program that uses a boolean flag variable in
determining whether two lists have any items in common.
"""

##list1 = [1,2,3,4,5]
##list2 = [8,9,10,1,11,12,13,5]
##commonFlag = False
##commonList = []
##for i in range(len(list1)):
##    for j in range(len(list2)):
##        if(list1[i] == list2[j]):
##           commonFlag = True
##           commonList.append(list1[i])
##print("Do the two lists have any items in common?",commonFlag)
##print("Items in common:",commonList)


#10-7######################################################
""" Write a program that creates the list
[1,11,111,1111,...,111...1], where the entries have an ever
increasing number of ones, with the last entry having 100
ones. """

##list1 = []
##ones = 1
##for i in range(100):    
##    list1.append(ones)
##    ones = str(ones)
##    ones +="1"
##    ones = int(ones)
##print("list1 = ",list1)    



#10-8######################################################
"""Write a program to find all numbers between 1 and 1000
that are divisible by 7 and end in a 6.
"""

##list1 = []
##for i in range(1,1001):
##    if(i%7==0 and i%10==6):
##        list1.append(i)
##print(*list1)


#10-9######################################################
"""
Write a program to determine how many of the numbers
between 1 and 10000 contain the digit 3.
"""

##ctr=0
##list1 = []
##for i in range(1,10001):
##    i = str(i)
##    if("3" in i):
##        list1.append(i)
##        ctr+=1
##print("There are " + str(ctr) + " numbers that contain a 3")
###print(*list1)


#10-20######################################################
""" Write a program that asks the user to enter a date in
the format mm/dd/yy and converts it to a more verbose
format. For example, 02/04/77 should get converted into
February 4, 1977. Test for all combinations of leading zeros:
02/04/77, 02/4/77, 2/04/77, 2/4/77 """

##import sys
##dateString = input("Enter a date (e.g.02/04/77): ")
##index1 = dateString.find("/")
##index2 = dateString.rfind("/")
##if (index1 == 2 and index2 == 5):   # 02/04/77
##    mmString = dateString[0:2].lstrip("0")
##    ddString = dateString[3:5].lstrip("0")
##    yyString = dateString[6:8]
##elif (index1 == 2 and index2 == 4): # 02/4/77 
##    mmString = dateString[0:2].strip("0")
##    ddString = dateString[3:4]
##    yyString = dateString[5:7]
##elif (index1 == 1 and index2 == 4): # 2/04/77 
##    mmString = dateString[0:1].lstrip("0")
##    ddString = dateString[2:4]
##    yyString = dateString[5:7]
##elif (index1 == 1 and index2 == 3): # 2/4/77 
##    mmString = dateString[0:1]
##    ddString = dateString[2:3]
##    yyString = dateString[4:6]
##else:
##    print("Invalid format")
##    sys.exit()
##    
##match mmString:
##        case "1": month = "January"
##        case "2": month = "February"
##        case "3": month = "March"
##        case "4": month = "April"
##        case "5": month = "May"
##        case "6": month = "June"
##        case "7": month = "July"
##        case "8": month = "August"
##        case "9": month = "September"
##        case "10": month = "October"
##        case "11": month = "November"
##        case "12": month = "December"
##        case _: print("Invalid month"); sys.exit()
##print("The verbose format is " + month + " " + ddString.lstrip("0") + ", 19" + yyString)


