Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
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&#...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents 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.…
Chapter 5 Solutions
Python Programming: An Introduction to Computer Science, 3rd Ed.
Ch. 5 - Prob. 1TFCh. 5 - Prob. 2TFCh. 5 - Prob. 3TFCh. 5 - Prob. 4TFCh. 5 - Prob. 5TFCh. 5 - Prob. 6TFCh. 5 - Prob. 7TFCh. 5 - Prob. 8TFCh. 5 - Prob. 9TFCh. 5 - Prob. 10TF
Ch. 5 - Prob. 1MCCh. 5 - Prob. 2MCCh. 5 - Prob. 3MCCh. 5 - Prob. 4MCCh. 5 - Prob. 5MCCh. 5 - Prob. 6MCCh. 5 - Prob. 7MCCh. 5 - Prob. 8MCCh. 5 - Prob. 9MCCh. 5 - Prob. 10MCCh. 5 - Prob. 1DCh. 5 - Prob. 2DCh. 5 - Prob. 3DCh. 5 - Prob. 4DCh. 5 - Prob. 5DCh. 5 - Prob. 1PECh. 5 - Prob. 2PECh. 5 - Prob. 3PECh. 5 - Prob. 4PECh. 5 - Prob. 5PECh. 5 - Prob. 6PECh. 5 - Prob. 7PECh. 5 - Prob. 8PECh. 5 - Prob. 9PECh. 5 - Prob. 10PECh. 5 - Prob. 11PECh. 5 - Prob. 12PECh. 5 - Prob. 13PECh. 5 - Prob. 14PECh. 5 - Prob. 15PECh. 5 - Prob. 16PE
Knowledge Booster
Similar questions
- can you please do this with java in eclipse ide please thank youarrow_forwardIn python read it part of the string until it reaches a second matching delimiter. This is why you can use a single quote in a string delimited by double quotes, and vice versa?arrow_forwardSection Test of Application... Note: You need to press "Final Submit" for your pr Given a string in which the same character occurs in many.consecutive character elements. Your task is to find the characters that have even frequency and are consecutive. Display the sum of every frequency count (For even frequency only). Example1: Input aaabbaccccdd Input String Output: Explanation: Input string "aabbaccccdd" contains 'a' 3 times, b' 2 times, again 'a' 1 time, 'c' 4 times, and 'd 2 times Here, the frequency of b.c and d is even and the frequency count is 2,4 and 2 respectively. Hence the output32-4-2%3D8 Example2: input: vdkkmmmnn Output Buns andur-arrow_forward
- In C++ Code with comments and output screenshot is must.No copy paste answer please!arrow_forwardIn Rust.arrow_forwardCreate a string from two given strings by concatenating common characters of the given strings. Sample Input harry, hermione dean, tom Sample Output hrrhr Nothing in common. Again, you have lost your USIS password!! You went to the registrar office and requested for a new password. This time, you need to follow some rules to set your password. Otherwise, they won't change it. The rules are At least one lowercase letter At least one uppercase letter At least one digit (0-9) At least one special character (_ , $ , #, @) Your task is to find whether a given password follows all those rules. If it breaks any rule, you have to print Lowercase Missing, Uppercase Missing, Digit Missing or Special Missing respective to the missing case. For more than one rule break, print all the rules that were broken (order doesn't matter). If the password is ok, print OK. Sample Input ohMyBR@CU ohmybracu OhMyBR@CU20 Sample Output Digit missing Uppercase character missing,…arrow_forward
- e) Create a new StringBuilder from the String "Prepare for your Midterm Exam". Check the capacity of the StringBuilder and if it's empty. Find the index of the letter 'y'. Delete a substring from the starting index till this index (of 'y'). Insert a string "Good luck on " at the beginning of the StringBuilder. Append '!" to it. Print your StringBuilder to Console.arrow_forwardCity and State. Extract the city name and state from strings like “Utica, NY” and “Los Angeles, CA”. Assume the state is always the last two characters in the string, the city name has at least one character, there is a comma following the city name, and a single space after the comma. Use the split method to separate the city name from the state (Notice the city name will still have a comma at the end). The following attachement is a sample execution:arrow_forwardI have to add this solution to a conversion code. This chapter is focused on strings and string manipulation, including slicing, searching, splitting, and case conversions. Can you help me with this? 1. Ask the user for their name and their email address before you display the results of the conversions. 2. When the user enters the email address search the string for the @ symbol. If the symbol is not found, ask the user to re-enter their email address till they get it right. 3. When you display the conversion output to the user, you must include the user’s name in the outputarrow_forward
- Change this code to show strings that help you cast twelve dice. They should be shown one at a time like this:The first one was A. The second one was B. Afterward, the sum should be shown on a different line.arrow_forwardPlease send me answer of this question immediately and i will give you like sure sirarrow_forwardWrite a program that reads a string and checks the longest substring starting with "a" and ending with "z" included in it. Note that, the substring cannot contain another a or another z in it. For example: Ifs="bcd bbccdd badefgze tabdz", the longest substring is: 6arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT