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
Why were low quality video so often use when Internet connection we’re poorer than they are today
kakasveta [241]
What do you mean? I’m confused with the question, it doesn’t make sense:)
8 0
3 years ago
Default tab stops are set in Word every _______ inch. <br> A. ½<br> B. 1<br> C. ¼<br> D. ¾
Amanda [17]
In order to help the student expand his/her knowledge I will help answer the question. This in hope that the student will get a piece of knowledge that will help him/her through his/her homework or future tests.

Default tab stops are set every one half inch across a page. This is a default measure that Microsoft established. The correct answer is letter

A. 1/2

I hope it helps, Regards.     <span> </span>
4 0
4 years ago
If you purchase a software suite for personal use, you can install the software how many times on how many different machines?
givi [52]

A software for personal use can be installed for a finite number of times as stated in the agreement signed between the customer and the supplier. Therefore the answer to this question is <span>“It depends upon the conditions stated in the license agreement”.</span>

8 0
4 years ago
what technology is used to prove that an object is a living organism, and what is the piece of evidence used to prove that?
den301095 [7]

Cells and microscope.

7 0
3 years ago
____ computers are used by large businesses, government agencies, and in science and education to provide centralized storage an
Charra [1.4K]

The answer to this question is the Mainframe Computer. Mainframe computers are used by large businesses, and government agencies because this computer can store large data and information. Mainframe basically known as a large cabinet because of its size and the frame stores the Central processing unit of the computer.  

3 0
4 years ago
Other questions:
  • HELP ME RIGHT NOW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    8·1 answer
  • A few questions related to power point.
    8·1 answer
  • Harry wants to change the background of all of his presentation slides. Which slide will enable him to make this change to all t
    14·1 answer
  • is the process of creating a message to be communicated. a. Encoding b. Decoding c. Receiving d. Sending
    10·2 answers
  • Arrange the following units of storage in descending<br> order. B, TB,KB, GB,MB
    5·1 answer
  • If you want to insert a table which ribbon should you select
    13·2 answers
  • According to the passage, what are the goals of the<br> program? Check all that apply.
    11·1 answer
  • HELPPP
    5·1 answer
  • It is a single strand of metal capable of transmitting power or data from one area to<br> another
    11·1 answer
  • What are some industries of aerodynamics and hydrodynamics? explain each one in detail.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!