Question 4 Write a function called convert_case( string, upper=False ) that takes a string and returns a new string where that string is converted to lowercase if upper keyword parameter is False and...


Don't give wrong answer. It's important, I'm facing errors.


Wrong answer would downvoted for sure


I need code with all test case should pass. With compilation of code


Question 4<br>Write a function called convert_case( string, upper=False ) that takes a string and returns a new string where that string is converted to lowercase if upper keyword parameter is False and converted to uppercase<br>otherwise.<br>[ : def convert_case( string, upper-False ):<br>irite your function according to the specifications given in the question.<br>Note that your function MUST Work in the general case as demonstrated below.<br># YOUR CODE HERE<br>pass<br>Test cases:<br>[ ]: assert convert_case(

Extracted text: Question 4 Write a function called convert_case( string, upper=False ) that takes a string and returns a new string where that string is converted to lowercase if upper keyword parameter is False and converted to uppercase otherwise. [ : def convert_case( string, upper-False ): irite your function according to the specifications given in the question. Note that your function MUST Work in the general case as demonstrated below. # YOUR CODE HERE pass Test cases: [ ]: assert convert_case( "abCde", upper=True ) = "ABCDE" assert convert_case( "abCde", upper=False ) = "abcde" assert convert_case( "abCde" ) "abcde" n'e" Question 5 Write a Python function strange_concat( a, b), which takes two strings, a and b and returns a string by concatenating the corresponding characters from each string, except that, for string b, concatenation will start from the end and move towards the beginning. Then the return value should have whatever remains from either string that does not have corresponding characters in the other string. If there are leftover characters from b, note that these will be in reverse order. [ 1: def strange_concat( a, b ): Write your function according to the specifications given in the question. Note that your function MUST work in the general case as demonstrated below. # YOUR CODE HERE pass Test cases: I ]: assert strange_concat( "abcde", "XYz" ) -- 'aZbYCXde assert strange_concat( "abc", "XYZPQR" ) - 'ARDQCPZYX
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here