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
Explain the difference between computer and computer systems.
9966 [12]

Answer: Computer commonly consists of HARDWARE and SOFTWARE. HARDWARE are the physical parts of the computer like keyboard, mouse, hard disk, processor, ram and Rom etc. SOFTWARE is the set of instructions that tells the computer what to do, For example Windows operating system, MS Word, MS Excel, Norton Anti virus all are software.

Explanation: plz add me as Brainiest

5 0
3 years ago
A search engine that crawls uses
RoseWind [281]

Answer:

web crawlers or spider software

Explanation:

A search engine that crawls uses the web crawler or the spider software. And it also uses the server side JavaScript based crawlers and programming languages like Python and PHP. The search engine finds the content category through the meta keywords and directs the page to the index. The index contains details of similar types of pages, And each page has one category, and if category is not found which is rarest, a new category is being created.

7 0
4 years ago
Westion<br> ufycfl<br> to city first city trusty court you to they'd
Helen [10]
I don’t understand. Please tell me the question
6 0
3 years ago
The ____ system is an example of a single-user Earth station satellite system with its own ground station and a small antenna (t
White raven [17]

Answer: VSAT(Very Small Aperture Terminal)

Explanation:

The computer system could be connected to the transceiver via an antenna and can send and receive data.

Using satellite communication the data could be send to the end user.

3 0
4 years ago
People often want to save money for a future purchase. You are writing a program to determine how much to save each week given t
GenaCL600 [577]
.................................
7 0
3 years ago
Read 2 more answers
Other questions:
  • Given two int variables, i and j, which have been declared and initialized, and two other int variables, itemp and jtemp, which
    14·1 answer
  • Which of the following is lost when the computer is turned off?
    11·1 answer
  • Which of the following is considered a basic task in the context of computer operations? a. Connecting to the Internet b. Natura
    6·1 answer
  • Can someone please help me
    15·1 answer
  • Network footprinting is used to ______________________. Group of answer choices test for vulnerabilities determine what services
    12·1 answer
  • Portable Document Format is a proprietary document file type created by Adobe Systems that is compatible with most computer syst
    7·1 answer
  • What is suitable equipment to meet customer needs from
    10·1 answer
  • Use the drop-down menus to complete the sentences about the Calendar view Arrange command group.
    6·1 answer
  • Does speedtest report megabytes per second or megabits
    6·1 answer
  • Why should teachers refrain from using extreme language, such as “I’m dying of hunger,” around four- and five-year-old children?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!