#source code in python:
def stringsort(data):
val=[i for i in data]
newval=sorted(val)
return "".join(newval)
print("cat becomes:",stringsort("cat"))
print("dog becomes:",stringsort("dog"))
![i WN def stringsort (data): val=[i for i in data] newval=sorted(val) return.join(newval) print(cat becomes, stringsort(c](http://img.homeworklib.com/questions/19228c50-d608-11ea-9cfe-3dbb58b40413.png?x-oss-process=image/resize,w_560)
#output:
Python follows indentaion use tabspace for indentaion type the code as the above screenshoot by using tab space otherwise it gives indentation error..

#if you have any doubt comment below...if you like give thumbs up...
python 1. Write a function that takes in a string and returns the string sorted For...
Write a python function that takes a string as input, and returns a dictionary of frequencies of all the characters in the string. For example: freq("dabcabcdbbcd") would return {"d":3, "a":2, "b":4, "c":3}. Then write a driver to demonstrate your function.
in python Write a function that takes a string as an argument returns a new string that is that string repeated 3 times.
IN PYTHON 3) Number of Words Write a function numWords() which takes in a string can prints the number of words in the string. You can assume that words will only be separated with spaces, commas, and periods. "hello, world" -> 2 "this is cool" -> 3 4) Is Sorted Write a function isSorted() which takes in an list of integers and returns true if the numbers are sorted from smallest to largest.
Write a function called double_str that takes a string argument and returns a new string that has all of the same characters as the argument, except each one is repeated twice. For example: double_str('dog') --> 'ddoogg' looking for python coding below is what I have so far double_str = 'robert' double_str 'robert' for i in range(len(double_str)): print(double_str[i])
Write a function maxList that takes in a list of integers as argument and returns their highest. You may not use the max() or the sorted() Python built-in functions.
ANSWER USING PYTHON Write a recursive function that takes 2 sorted lists as arguments and returns a single, merged sorted list as a result. For example, if the two input lists are [0, 2, 4, 6, 8] and [1, 3, 5, 7, 9], the returned result should be [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]. Remember that you can add lists in Python using the + operator ([0] + [1,2,3] = [0,1,2,3]) and can take slices of...
Python 3: Write a function called every_other_character() that takes in a string and returns a new string with every other character removed. That is, the new string will include the first, third, fifth, etc. letters of the given string. Must use a while or for loop in the solution.
Create a function named make_polite that takes in a string named message and returns it with ", please"added to the end. Test the function by calling it on the following messages: "Pet the dog" and "Walk the dog". Make sure you print the result of calling it. Please write in Python
1 write a Python function that takes in a list of integers and returns maximum and minimum values in the list as a tuple. Hint (can be done in one pass, you are not allowed to use built-on min and max functions.)max, min = find_max_min(my_list):2 write a Python function that takes in a list of integers (elements), and an integer number (num). The functions should count and return number of integers in elements greater than, less than, and equal to...
With using Python . Write a function that: 1. Takes two arguments and returns the product of the arguments. The return value should be of type integer. 2. Takes two arguments and returns the quotient of the arguments. The return value should be of type float. 3. Takes one argument and squares the argument. It then uses the two values and returns the product of the two arguments.(Reuse function in 1.) 4. Takes one argument and prints the argument. Use...