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
AfilCa [17]
3 years ago
6

Write a Python program which asks a user for a word and performs letters manipulation. If the word is empty, the program should

print the message empty! Otherwise, if the word has between one and four letters (inclusive), the program should print the reversed word. Otherwise, the program should print a word made of the first two and the last two letters of the original word. Your program should match the sample output as displayed below.
Sample Output
Enter a word:
Result: empty!

Enter a word: bio
Result: oib

Enter a word: memory
Result: mery
Computers and Technology
1 answer:
never [62]3 years ago
8 0

Answer:

The program is as follows:

word = input("Enter a word: ")

if word:

   if len(word) <= 4:

       word = word[::-1]

   else:

       word = word[0]+word[1]+word[-2]+word[-1]

   print(word)

else:

   print('empty!')

Explanation:

This gets input for word from the user

word = input("Enter a word: ")

If input is not empty

if word:

This checks if the length is less than or equal to 4 characters

   if len(word) <= 4:

If yes, this reverses the word

       word = word[::-1]

If otherwise,

   else:

This gets the first, second, second to last two characters

       word = word[0]+word[1]+word[-2]+word[-1]

Print the new string

   print(word)

Print empty, if input is empty

<em>else: </em>

<em>    print('empty!')</em>

You might be interested in
Plz I need help 30 points
Kisachek [45]

hey mate your ans

in the picture

8 0
3 years ago
There is only one way to change line spacing in Word.
kobusy [5.1K]
False Line spacing options

Single    This option accommodates the largest font in that line, plus a small amount of extra space. The amount of extra space varies depending on the font that is used.

1.5 lines    This option is one-and-one-half times that of single line spacing.

Double    This option is twice that of single line spacing.

At least    This option sets the minimum line spacing that is needed to fit the largest font or graphic on the line.

Exactly    This option sets fixed line spacing, expressed in points. For example, if the text is in a 10-point font, you can specify 12 points as the line spacing.

Multiple    This option sets line spacing that can be expressed in numbers greater than 1. For example, setting line spacing to 1.15 will increase the space by 15 percent, and setting line spacing to 3 increases the space by 300 percent (triple spacing).

hope this help
4 0
4 years ago
Which key on a laptop keyboard is often used to help pair a mobile device with another device for communication purposes?
Nonamiya [84]

Bluetooth on a laptop is often used to help pair a mobile device with another device for communication purposes.

  • Bluetooth

<u>Explanation:</u>

A Bluetooth gadget works by utilizing radio waves rather than wires or links to associate with your mobile phone, cell phone or PC. Bluetooth is a remote innovation standard utilized for trading information among fixed and cell phones over short separations utilizing short-wavelength UHF radio waves in the modern, logical and restorative radio groups, from 2.400 to 2.485 GHz, and building individual zone systems. For instance, on Windows, either right-click the Bluetooth symbol in the notice zone or go to the Control Panel to discover the Hardware and Sound > Devices and Printers page. At the point when the gadget shows up in the rundown of Bluetooth and different gadgets, select it to associate (pair) it to the workstation.

7 0
4 years ago
When _______ wordart, you need to consider both the font size of the text and the size of the text box that contains wordart?
padilas [110]
The correct answer is resizing. If you're making a logo and creating wordart. you have to care about resizing because the art needs to be clearly visible and appealing no matter the size. If you place it in a box, you have to care that it doesn't go over the edges of the box or anything similar that might seem appalling.
4 0
4 years ago
What is the minimum recommended point size for presentation text?<br> 12<br> 24<br> 36<br> 48
Darya [45]
The answer would be 24
6 0
3 years ago
Other questions:
  • Gary lives in an area that receives high rainfall throughout the year. Which device would be useful to him to maintain his compu
    10·2 answers
  • 1. Caches are important to providing a high-performance memory hierarchy to processors. Below is a list of 32-bit memory address
    7·1 answer
  • To save a file so that it can be opened on most computers, select the ____ option.
    10·2 answers
  • A(n) _____ is someone who uncovers computer weaknesses and reveals them to manufacturers or system owners, without exploiting th
    15·1 answer
  • A Windows user right-clicks on his desktop. What is he planning to do?
    10·1 answer
  • What does "scanf(\"%d\" mean?
    13·2 answers
  • Point out the wrong statement.
    10·1 answer
  • 2. The internet offers a great source of information; however, how are
    9·1 answer
  • Your development server is experiencing heavy load conditions. Upon investigating, you discover a single program using PID 9563
    5·1 answer
  • Modern life is not possible if computer stops working? Give your opinion<br>​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!