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
Write an application that displays the strings in the provided array alphabetically in ascending order.
mr Goodwill [35]

Answer:

Explanation:

The following code is written in Python and it is a very simple function/program that takes in an array of strings as a parameter called names. This array is then passed the built-in sort function which automatically sorts it in ascending alphabetical order. Finally, the print method is called on the names array to print all of its elements out.

def sort_strings(names):

   names.sort()

   print(names)

8 0
3 years ago
TLO 06 Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure.a. Trueb. False
Elan Coil [88]

Answer:

b. False

Explanation:

Active Directory Domain and Trusts tool is used for the following operations:

1. To increase the domain functional level

2. To increase forest functional level

3. To add UPN suffixes

4. To manage domain trust

5. To manage forest trust.

Hence, the correct answer is: it is FALSE that Active Directory Domain and Trusts tool is used to move servers between site in an AD Infrastructure

4 0
4 years ago
What are the 3 rules of music<br><br> ps: there is no music subject so i had to put something else
Kitty [74]

Answer:

Rules that apply to all situations and accasions in the music room

Explanation:

I hope this helps

7 0
3 years ago
Read 2 more answers
Which is an effect of short-term environmental changes?
allochka39001 [22]
Adaptation or death






.
4 0
3 years ago
Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new vi
umka2103 [35]

Answer:

The total cost is $13.0

Explanation:

Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new videos for $3.00 a night, and oldies for $2.00 a night.

Write a program that the clerks at Five Star Retro Video can use to calculate the total charge for a customer's video rentals.

The program should prompt the user for the number of each type of video and output the total cost.

8 0
3 years ago
Other questions:
  • Choosing firm goals for your business
    7·2 answers
  • Write a program to generate personalized junk mail. The program takes input both from an input file and from the keyboard.The in
    14·1 answer
  • When you set up a worksheet, you should use cell references in formulas whenever possible, rather than ____ values.
    11·1 answer
  • Applications software is also known as
    14·2 answers
  • Consider a system consisting of m resources of the same type, being shared by n processes. Resources can be requested and releas
    13·1 answer
  • Describe how the presence or absence of balance can affect a visitor’s perceptions of a Web page.
    7·1 answer
  • HELLO <br> any edmentum people out there.
    15·2 answers
  • A computer is performing a binary search on the sorted list of 7 numbers below. What is the maximum number of iterations needed
    15·1 answer
  • Como a contribuido el desarrollo tecnologico a mejorar la calidad debida de los seres humanos
    11·1 answer
  • Send link for a qc or paddle
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!