Question: using python and applying Strings to solve the problem You may use any of the Python 3 String methods: https://docs.python.org/3/library/stdtypes.html#string methods to comp Note: You

 using python and applying Strings to solve the problem You may
use any of the Python 3 String methods: https://docs.python.org/3/library/stdtypes.html#string methods to comp
using python and applying Strings to solve the problem

You may use any of the Python 3 String methods: https://docs.python.org/3/library/stdtypes.html#string methods to comp Note: You may want to spend some time reading about the String methods prior to attempting this assignment. 1. (5 pts) Write a function firstAlpha1 that: 1. Takes two argument: both strings 2. Returns the one that comes first alphabetically (case sensitive) according to the unicode character set (Basic Latin 3. Your function should handle duplicates 4. Examples: firstAlpha("ABC","abc")->"ABC" - firstAiphal("DEF", "ABC") -> "ABC" firstAlpha("DEF","abc")--> "DEF" . firstAlpha 1 ("abcabc")--> "abc" firstAlpha("abc" "acd")-> "abe" 2. (15 pts) Write a function firstAlpha2 that: 1. Takes two argument: both strings 2. Returns the one that comes first alphabetically (case insensitive): 3. Your function should handle duplicates 4. Examples: - firstAlpha2 "ABC.abc)--> "ABC" or "abc - firstAlpha ("DEF "ABC")--> "ABC firstAlpha2/"DEF abc). abc firstAlpha2("abead")--> "abc" HINT: See string methods upper or lower 3. (10 pts) Write a function oddletters that 1. Takes one argument: a string 2. Returns a string that is comprised of the odd-indexed characters of the argument 3. Examples oddlettere abcdefg) - bar oddletters it can have spaces) - tento pcs Tentalire that 4. (15 pts) Write a function oppositeCapitalize that: 1. Takes one argument: a string of letters 2. Returns a string that is equivalent to the argument the first letter is lowercase and the rest of the letters are uppercase 3. Examples: . oppositeCapitalize(abcdefg) -'aBCDEFG oppositeCapitalize('hello) -- HELLO 5. (15 pts) Write a function enthusiasm that: 1. Takes one argument a string (containing one or more words separated by spaces) 2. Returns a string that is equivalent to the argument with each word capitalized and with an exclamation point after it 3. Examples enthusiasm(this is an example) - This is And Exampler enthusiasm("short) - Shorts HINT: You may want to use the string method split (but not required) 6. (20 pts) Write a function convertifPossible that 1. Takes one argument a string 2. Returns a int that is equivalent to the argument if every character in the argument is numeric 3. Returns a -1 If conversion is not possible 4. Examples: convertifpossible('12345") - 12345 - convertitPossible("short) - 1 Note: You may not use a try... except block for this problem 7.(20 pts) Write a function shortest Word that: 1. Takes one argument: a string containing one or more words separated by whitespace) 2. Returns the shortest word in the argument with no modification if there are multiple shortest words. It returns the first one to occur in the argument 3. Examples: - shortestward this is a very short sentence's shortestwordi Even shorter - Even shortestword this is an example) HINTI You may want to use the string method wit but not required)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Lets solve each problem stepbystep using Python 1 Function firstAlpha1 Objective Returns the string ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!