Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python Evaluate and write code that extracts substrings from strings using indexing, slicing, and string library methods explained in the book to evaluate and

image text in transcribed

In python Evaluate and write code that extracts substrings from strings using indexing, slicing, and string library methods explained in the book to evaluate and to write code that uses conditional statements. In yarnoneplease myt note which #d conditional structure you'd use and why-how it is unique to fit this problem? Second, please write code using it. Write a program that reads in input from the user. The user will type their favorite foreign country. If the letter 'e' exists in this input, print the number of times that the letter 'e' occurs. If it doesn't, print an appropriate message ALONG WITH the oniginal string itself. -Hint: Which of the above 6 conditional structures would you use? Might you need a keyword too? Write a program that reads in input from the user. The input should be the year that the student was bom. Keep the input as a string. Now, slice that string into 4 characters each stored in their own variable. Treating those digits as numbers first check to make sure that the student wasn't bom in the 2000s. If they were, print "Aren't you too young to be in college?" Otherwise, if the student was bom during or before the year 1980, print "Where were you on Y2K?" If the student was bon after 1980 but before 1990, print "What are liquor stores like?" If the last digit in the student's year of birth is less than 6, print "You're close to Reid's age Othewise, print the oiginal input string What rahge must the last digit be in given the above logic

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago