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
Write a program to insert student grade and print the following
tangare [24]

Answer:

The answer is the program, in the explanation

Explanation:

I am going to write a C program.

int main(){

int grade = -1; /*The grade will be read to this variable*/

/*This loop will keep repeating until a valid grade is inserted*/

while(grade < 0 || grade > 100){

         printf("Insert the student's grade: %n");

         scanf("%d", &grade);

}

/*The conditional according to the grade value*/

if (grade >= 90){

     printf("Your grade is A\n");

}

else if (grade >= 80 && grade < 90){

     printf("Your grade is B\n");

}

else if (grade >= 70 && grade < 80){

     printf("Your grade is C\n");

}

else if (grade >= 60 && grade < 70){

     printf("Your grade is D\n");

}

else{

    printf("You got a failling grade\n");

}

return 0;

}

8 0
4 years ago
While working on a presentation, Jack lost all the data because he switched off his computer unknowingly. On which of these comp
Lelechka [254]

Random Access memory(RAM) stores data temporary until the computer is switched off

3 0
3 years ago
Read 2 more answers
What is a algorithm design ​
Mazyrski [523]

Answer:

Explanation:

Algorithm design is the branch of discrete mathematics and computer science that deals with the research, development and implementation of sequential and asynchronous algorithms. ... An algorithm is simply a sequence of instructions; a recipe is an algorithm, and so is a list of driving instructions.

6 0
3 years ago
Please help me with coding!
tresset_1 [31]

Answer:

key code space

Explanation:

the transformation

6 0
3 years ago
Read 2 more answers
How many computers/laptop's suported windows 10 pro with a game in vr?
Papessa [141]

REQUIREMENTS NEEDED FOR COMPUTERS TO SUPPORT VR

Today, there are a wide variety of VR systems available to the average consumer. Virtual reality offers an immersive experience for hardcore gaming enthusiasts, but your PC might require updates in order to support your VR system. VR compatibility will depend on the specifications of your CPU, GPU, RAM, hard drive, and other core components. In this informative guide, we dive deep into some of the most popular VR systems on the market, as well as system requirements provided by the manufacturers of Oculus Rift and HTC Vive VR headsets. With our help and the right components, you can prepare your desktop or laptop computer for the rich visuals of virtual reality gaming.

PC REQUIREMENTS NEEDED TO SUPPORT VR

Whether you’re in the market for a new PC, building a high-end rig for gaming, or upgrading your PC to virtual reality standards, the hardware requirements of your VR system are essential to achieving the ultimate VR experience. The official requirements and hardware demands will vary from Oculus to Vive systems.

OFFICIAL OCULUS RIFT RECOMMENDATIONS

With a PC built to official recommendations, you can play almost any game on maximum settings on a standard 1080p monitor. These specifications ensure that developers can optimize for a known hardware configuration.

CPU: Intel Core i3-8100

GPU: RX 570 (or GTX 1060 3GB)

Motherboard: ASRock Z370 Pro4

Storage 1: Seagate Barracuda 1TB HDD

Storage 2: None (or Crucial MX500 250GB SSD)

Power Supply: Seasonic S12II 620

RAM: 8GB DDR4

Case: Corsair 200R

CPU Cooler: Stock (or Deepcool Gammaxx 400)

Operating System: Windows 10

Official HTC Vive Recommendations

GPU: Nvidia GeForce GTX 970 or AMD Radeon R9 290 equivalent

CPU: Intel i5-4590 or AMD FX 8350 equivalent

RAM: 4 GB or more

Video Output: HDMI 1.4, DisplayPort 1.2 or newer

USB Port: 1x USB 2.0 or better port

Operating System: Windows 7 SP1, Windows 8.1 or later, Windows 10

RELIABLE BUILD FOR VR GAMING

There’s no need to spend a large amount of money to play games with reasonable detail and high frame rates. With case, motherboard, power supply, and solid state drive updates, you can get a great value and better performance.

CPU: AMD Ryzen 5 1600

GPU: GeForce GTX 1070

Motherboard: MSI B350M Gaming Pro

Storage 1: Crucial MX500 250GB SSD

Storage 2: Seagate Barracuda 2TB HDD

Power Supply: EVGA GQ 650W

RAM: 16GB DDR4

Case: Corsair Carbide 270R

CPU Cooler: Stock

Operating System: Windows 10

HARDCORE BUILD FOR VR GAMING

Prepare your PC for VR games that haven’t even hit the market yet and achieve 90 FPS in any game made for Rift or Vive, all while staying within a budget of $2,000 or less.

CPU: AMD Ryzen 5 1600X

GPU: GTX 1080

Motherboard: MSI B350 PC Mate

Storage 1: Crucial MX500 500GB SSD

Storage 2: Seagate Barracuda 2TB HDD

Power Supply: EVGA 850 G2

RAM: 16GB DDR4

Case: Corsair Crystal 460X or Enthoo Pro

CPU Cooler: Noctua NH-U12S SE-AM4

Operating System: Windows 10

4 0
3 years ago
Read 2 more answers
Other questions:
  • A(n)___ is divided into rows and columns.<br> What goes in the blank?
    7·1 answer
  • Compare pseudocode and flowcharts for designing computer programs, and discuss the advantages and disadvantages of each.
    13·1 answer
  • What is the code range for the integumentary system subsection in the cpt coding manual?
    6·1 answer
  • 6. Write a program that can multiply an n x m matrix and m x n matrix together: The input specifications are these: Read n and m
    11·1 answer
  • Does players report you on Mobile legends bang bang for playing your own Music while your playing yes or no
    11·1 answer
  • What is the printout for the first statement in the main method?
    13·1 answer
  • Which army regulation would be referenced if you want to properly mark removable ais storage media?
    6·1 answer
  • Claire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of
    13·1 answer
  • What’s an input Device
    7·2 answers
  • I live in Pennsylvania which observes eastern standard time.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!