Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
Expert Solution & Answer
Book Icon
Chapter 5, Problem 1PE

Explanation of Solution

Program:

//Definition of class "main"

def main():

{

    //Declaration of variables

    day = int(input(“Enter the day number:”)

    month = int(input(“Enter the month number:”)

    year = int(input(“Enter the year:”)

    //Definition of variable date1

    date1 = str(month)+”/”+ str (day)+”/”+ str (year)

    //Declaring months

    months = [“January”,”February”,”March”,”April”,”May”,

     ”June”,”July”,”Augustt&#...

Blurred answer
Students have asked these similar questions
Please help me
How do I create a wordle like game using C++? Instructions are to create a “target word” by assigning a five-letter word to a string variable. Remember the user’s guess must be: exactly 5 letters long and contain only lowercase letters from a to z. have 6 guesses to get the word Don’t worry about whether it is a valid 5-letter word at this point. Just compare it to the “target word” and report whether it is a match.
For this project, you will be writing regular expressions that look for and find all instances of a date in any given string. Your program should: Find the following different formats for dates: August 2nd, 1994 august 2, 1994  08/02/1994 08/02/94 08-02-1994 Your program should be case insensitive using re.IGNORECASE Your program can only have a maximum of two different regexes. A special prize goes to those of you who can fit all of this into one regex Your program should be able to tell if the date is a valid date. For example, if the date says 99/99/99, then your program should ignore this as a date. HINT: this is not done within the regex. Try saving your dates to something like a list and going through that list after your regex runs.  At the end of your program, it should print out all of the dates in the following format: mm/dd/yyyy. EX. 08/02/1994 Your program should use at least two character classes, you may need more. Feel free to make your own custom classes as well.…
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781305480537
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT