Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

For each function, describe what it actually does when called with a string argument. If it does not

correctly check for lowercase letters, give an example argument that produces incorrect results, and

describe why the result is incorrect.

# 1

def any_lowercase1(s):

for c in s:

if c.islower():

return True

else:

return False

# 2

def any_lowercase2(s):

for c in s:

if 'c'.islower():

return 'True'

else:

return 'False'

# 3

def any_lowercase3(s):

for c in s:

flag = c.islower()

return flag

# 4

def any_lowercase4(s):

flag = False

for c in s:
flag = flag or c.islower()

return flag

# 5

def any_lowercase5(s):

for c in s:

if not c.islower():

return False

return True
• Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.
Create your own example of each possibility in Python code. List the code for each example, along with sample output from trying to run it.
Do Exercise 6.4 from your textbook using recursion and the is_divisible function from Section 6.4. Your program may assume that both arguments to is_power are positive integers. Note that the only positive integer that is a power of "1" is "1" itself.

After writing your is_power function, include the following test cases in your script to exercise the function and print the results:

print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3)
Invent your own function that does some useful computation of your choosing. Do not copy the
function from somewhere else. Use incremental development, and record each stage of the
development process as you go. Finally, print output that demonstrates that the function works as
you intended.
Include all of the following in your Learning Journal:
An explanation of each stage of development, including code and any test input and output.
The output of three calls to your function with diàerent arguments.
use incremental development to write a function called hypotenuse that returns
the length of the hypotenuse of a right triangle given the lengths of the other two legs as
arguments. Record each stage of the development process as you go.
After the Õnal stage of development, print the output of hypotenuse(3, 4) and two other calls to
hypotenuse with diàerent arguments.
Include all of the following:
An explanation of each stage of development, including code and any test input and output.
The output of hypotenuse(3,4).
The output of two additional calls to hypotenuse with diàerent arguments
Create your own animation. At a minimum, it should have two circles and three lines in it.
Enter side A: 11
Enter side B: 2
Enter side C: 4
Enter side D: 7
Enter side E: 1
using recursion
After writing your is_power function, include the following test cases in your script to exercise the function and print the results:

print("is_power(10, 2) returns: ", is_power(10, 2))
print("is_power(27, 3) returns: ", is_power(27, 3))
print("is_power(1, 1) returns: ", is_power(1, 1))
print("is_power(10, 1) returns: ", is_power(10, 1))
print("is_power(3, 3) returns: ", is_power(3, 3))

You should submit a script file and a plain text output file (.txt) that contains the test output. Multiple file uploads are permitted. Don’t forget to include descriptive comments in your Python code.

Your submission will be assessed using the following Aspects.

Does the submission include the is_divisible function from Section 6.4 of the textbook?
Does the submission implement an is_power function that takes two arguments?
Does the is_power function call is_divisible?
Does the is_power function call itself recursively?
Invent your own function that does some useful computation of your choosing. Do not copy the function from somewhere else. Use incremental development, and record each stage of the development process as you go. Finally, print output that demonstrates that the function works as you intended.

Include all of the following in your Learning Journal:

An explanation of each stage of development, including code and any test input and output.
The output of three calls to your function with different arguments.
LATEST TUTORIALS
APPROVED BY CLIENTS