Question
Design a function called print_longer that will take as arguments two strings and will print the string that is the longer of the two. If
Design a function called print_longer that will take as arguments two strings and will print the string that is the longer of the two. If the strings are both the same length, the string that is the first argument is printed. You will want to use Pythons built-in len function to get the length of each string.
Examples of using len:
>>> len('hi')
2
>>> len('hello there')
11
Example call to print_longer:
>>> print_longer('hey there', 'hello')
hey there
2. Design a function called print_zodiac_sign that will take two arguments: one for the month as a String and one for the day. The function should print the name of the zodiac sign for the specified month and day (you are not printing the image). Your design can assume the function will be called with a valid date, you need not test for invalid dates, but you must test all boundary cases for valid dates. NOTE: spelling mistakes will result in failed tests when your submission is graded ensure you spelled all of the signs correctly in your program! Example:
>>> print_zodiac_sign('May', 4)
Taurus
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started