Answer:
The program in Python is as follows:
word = input("Word: ")
if len(word) < 5:
print("At least 5 characters")
else:
pal = word[0:5]
word = word[0:4]
word = word[::-1]
pal+=word
print(pal)
Explanation:
This gets the word from the user
word = input("Word: ")
This checks if the length of the word is less than 5.
if len(word) < 5:
If yes, this tells the user that at least 5 characters is needed
print("At least 5 characters")
If otherwise
else:
This extracts the first 5 characters of the word into variable named pal
pal = word[0:5]
This extracts the first 5 characters of the word into variable named word
word = word[0:4]
This reverses variable word
word = word[::-1]
This concatenates pal and word
pal+=word
This prints the generated palindrome
print(pal)
Answer : True
Explanation: Vectors can hold, data of the same type and can automatically expand accordingly and change it’s size. The date stored in vectors should be linear.
- The syntax for vector is vector<int>v;
- Mostly this is used in C++ as an alternative to arrays
- If you want to use vector in your program then define it in the header first i.e.
#include <vector>
- Push back is a function, that is used to insert an element into the vector
- Pop back removes the element from the vector
Answer:
Hardware layer
Explanation:
The hardware layer's job is to maintain and put to action central processor units and memory. Hardware layer first check the availability of the for mentioned duo and then decides the need to put one or another into action. Physical and data link layers act the same in the hardware layer. They bot are waiting to be called in action
<span>The kill -9 2129, kill -s KILL 2129, or kill -KILL 2129 commands</span>