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
dybincka [34]
3 years ago
14

Create a Python program in a file named loops1.py that does the following: a. Use a while loop to keep asking the user for input

until the length of the input is at least 10. b. When the user finally enters an input that is 10 or more characters, proceed as follows: i. If the length of the input is even, print the input string back in all lowercase. ii. If the length of the input is odd, print the input string back in all uppercase.
Computers and Technology
2 answers:
Rashid [163]3 years ago
7 0

Answer:

mystr = input("Enter a string ")

length = len(mystr)

while length<10:

   mystr = input("Enter a string ")

   length = len(mystr)

   if(length>=10):

       break

if len(mystr)%2==0:

   print(mystr.lower())

else:

   print(mystr.upper())

Explanation:

The variable mystr is used to save user's input which is received with the input function

A second variable length is used to save the length of the input string Using a while statement the user is continually prompted to enter a string while length is less than 10.

If length is greater or equal to 10. We check for even or odd using the modulo (%) operator.

We use lower() and upper() to change the case of the string

Mandarinka [93]3 years ago
5 0

Answer:

myvalue = input("please input your value: ")

while len(myvalue) < 10 :

      myvalue = input("please input your value: ")

      if len(myvalue) >= 10:

               break

if len(myvalue)%2 == 0:

      print(myvalue.lower())

else:

       print(myvalue.upper())

Explanation:

Create a python program file and name the file as loops1.py in accordance to what the question stated. Note to run this file you must have installed python software on your system.

Interpreting the code,

myvalue = input("please input your value: ") simply prompt the user to input a value .

while len(myvalue) < 10 : and  myvalue = input("please input your value: ")  This is a while loop that prompts the user to input another values if the initial value length inputted is less than 10.

if len(myvalue) >= 10: If the length of the value is equal or greater than 10 then the break  statement terminates the while loop entirely.

if len(myvalue)%2 == 0:  If the length of the value inputted divided by 2 is equal to 0, the lower case version(print(myvalue.lower())) of the value is printed out.

else:  

The uppercase value is printed( print(myvalue.upper()))

NOTE python use indentation.

You might be interested in
What are the differences between a trap (aka software interrupt) and an interrupt (hardware interrupt)? What is the use of each
Marta_Voda [28]

Answer:

Trap is a software interrupt that occurs when there is a system call, while hardware interrupt occurs when a hardware component needs urgent attention.

Explanation:

Interrupt is an input signal that disrupt the activities of a computer system, giving immediate attention to a hardware or software request.

In trap interrupt, the system activities are stop for a routine kernel mode operation, since it has a higher priority than the user mode. At the end of the interrupt, it switches control to the user mode.

The hardware interrupt is a signal from hardware devices like the input/output devices, storage and even peripheral devices that draws an immediate attention of the processor, stopping and saving other activities and executing the event with an interrupt handler.

6 0
3 years ago
Define each of the following data mining functionalities: characterization, discrimination, association and correlation analysis
Step2247 [10]

Answer:

In the clarification portion below, the definition according to the received information is summarized.

Explanation:

  • <u>Characterization:</u>

It is indeed a summary of general object characteristics in something like a target class and creates characteristic laws.

  • <u>Discrimination:</u>

Just before predefined data types have been held to a different standard from everyone else, it's indeed bias which always happens.

  • <u>Association:</u>

It's a mechanism that determines the possibility that objects in a set will co-occur.

  • <u>Classification:</u>

It is indeed duction which attributes elements to target groups or classes in a set.

  • <u>Prediction:</u>

It is solely dependent on either the interpretation of other similar values to classify data points.

  • <u>Clustering:</u>

It has been used to position the components of the information through their corresponding classes.

  • <u>Evolution Analysis:</u>

It would be for objects whose behavior varies throughout time to explain or design regularities.

5 0
3 years ago
Shop anywhere. Snap every receipt. Earn FREE gift cards! Sign up for Fetch with my code "DUEUY" and get 2,000 points when you sn
katovenus [111]

Answer:

mk

Explanation:

i think its DUEUY

4 0
3 years ago
What is the name of the technology that integrates vast data bases with georeferenced data in order to design, plan, and manage
ivanzaharov [21]

Answer:

"Geographic information systems " is the right answer.

Explanation:

  • This is indeed a computer-based method for observing and analyzing current events that are happening on the planet. GIS could enhance teaching and learning begin to understand geographical trends and regularities by relaying completely unconnected information.
  • It represent an experimental field and while the GIS supplier government offers us modern, improved, and quicker technical resources for the computer hardware.
7 0
3 years ago
A company needs to store its documents in one place, share news and information with all staff, and allow access for employees w
Greeley [361]
An NAS
Would do The Trick
4 0
3 years ago
Other questions:
  • A disk rotates at a rate of 7200 revolutions per minute. Seek operations (i.e., moving the access head to a desired track) take
    6·1 answer
  • Which item refers to an illusion of figures and shapes in motion, which we commonly see in movies and video games?
    9·1 answer
  • To share a document in my online electronic journal, I should select the option to _____.
    14·1 answer
  • _______ tools enable people to connect and exchange ideas.
    7·2 answers
  • _______ is a communications protocol used to send information over the web. HyperText Markup Language (HTML). URL (Uniform Resou
    10·1 answer
  • Brainliest to whoever answers this first, i need help explaining.
    8·1 answer
  • Which of these is the function of a modeler?
    5·2 answers
  • What will be the results of executing the following statements? x.setEditable(true); x.setText("Tiny Tim"); a. The text field x
    7·1 answer
  • How can I call moderator in braily app ???
    5·1 answer
  • Which of the following recommendations should you follow when placing access points to provide wireless access for users within
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!