1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Drupady [299]
4 years ago
8

This assignment is based on Exercise 8.4 from your textbook. Each of the following Python functions is supposed to check whether

its argument has any lowercase letters.
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.

def any_lowercase4(s):
flag = False
for c in s:
flag = flag or c.islower()
return flag
print(any_lowercase4(s))
Computers and Technology
1 answer:
seropon [69]4 years ago
8 0

Answer:

The answer is "True".

Explanation:

Following are the correct code to this question, at which it will give "true" output:

def any_lowercase4(s): #defining method any_lowercase4

   flag = False #defining flag variable and assign boolean value

   for c in s: #define loop that collect s variable value

       flag = flag or c.islower() # using flag variable that checks passes value in lower case

   return flag #return flag value

s="Row Data" #assign string value in s variable

print(any_lowercase4(s)) #call method and prints its return value

Output:

True

Program explanation:

  • In this code a method "any_lowercase4" is defined, that accepts a variable s in its parameter, inside the method "flag" variable is used, that assign a value, that is false.
  • In the next line, for loop is declared, inside the loop flag variable check parameter value into the lower case with or operator, and returns flag value.
  • In the last line, inside the print method, the method "any_lowercase4" is called that accepts a string value.
You might be interested in
What is the code i need to do
Greeley [361]
What section is it? I did the same thing a bit ago on edhesive
3 0
3 years ago
What does % find on edhesive??
statuscvo [17]

Answer:

Explanation: What is that word you typed?

3 0
3 years ago
A doorknob is an example of which simple machine?
Zarrin [17]
A doorknob is an example of a:
D. Wheel and Axle. 
I hope this helped ^_^
3 0
3 years ago
Read 2 more answers
What is the missing line of code? >>>from math th import >>> Point = [1,5) >>> bPoint [4.9]​
Ulleksa [173]

Answer:

I believe import math.

Do let me know if its correct.

3 0
2 years ago
Critique and rank four different brands of antivirus software, rating them by price, functionality, and system requirements. Pre
scoundrel [369]

Answer:

Explanation:yes it's true bc you need to order them bye what they are and hope this is right of it isn't I'm truly sorry

5 0
3 years ago
Other questions:
  • 1. What does a transistor do?
    6·1 answer
  • Show the CREATE TABLE statements for HAPPY INSURANCE database for the table CLIENT (assume that non-primary key columns can be o
    7·1 answer
  • landon starts his computer and gets message, hard drive is not found. He was watching a movie the previous night, what might the
    6·1 answer
  • Match the vocabulary word to the accurate definition. A software program that enables you to search for, interact with, and retr
    5·2 answers
  • Why would an information systems security practitioner want to see network traffic on both internal and external network traffic
    5·1 answer
  • Convert the following denary numbers into
    14·1 answer
  • Help please I would really appreciate <br>​
    5·2 answers
  • Consider a file/directory with the following info:
    14·1 answer
  • What are some potential challenges that society will face given the digital revolution? You may want to think particularly of th
    10·1 answer
  • A server malfunction has been resolved after replacing a failed hard drive. Enterprise services have been restored. What is the
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!