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
Alex
3 years ago
12

Special words are those words that start and end with the same letter. [14]

Computers and Technology
1 answer:
wel3 years ago
3 0

Answer:

<em>This program is written in python programming language</em>

<em>The program uses few comments (See Explanation for further explanation of each line)</em>

<em>See attachment for proper format view of the source code</em>

<em>Program starts here</em>

<em></em>

#Prompt user for Input

inpstring = input("Enter a string: ")

#Reverse user input

revstring = inpstring[::-1]

#Calculate length of user input

i = len(inpstring)

if(inpstring.upper() == revstring.upper()):

     print("The input string is Palindrome")

else:

     if(inpstring[0].upper() == inpstring[i-1].upper()):

           print("The input string is a Special Word")

     else:

           print("The input string is neither Palindrome nor Special")

Explanation:

inpstring = input("Enter a string: ")-> This line accepts input from user

revstring = inpstring[::-1]-> This line reverses user input

i = len(inpstring)-> This line calculates the length of user input

The following if statement checks for palindromes; i.e. if input string is equal to reversed string

if(inpstring.upper() == revstring.upper()):

     print("The input string is Palindrome")

If the above is statement is not true, the following is executed (to check for special word)

else:

The following if statement checks if the first letter of the input string is equal to its last letter

     if(inpstring[0].upper() == inpstring[i-1].upper()):

           print("The input string is a Special Word")

If the above statement if not true, then input string is not a special word and it's not palindromic.

Hence, the its accompanying else statement will be executed

     else:

           print("The input string is neither Palindrome nor Special")

You might be interested in
A memory page containing a heavily used variable that was initialized very early and is in constant use is removed, then the pag
kompoz [17]

Answer:

C. FIFO

Explanation:

The first-in, first-out (FIFO) page replacement algorithm is a low-overhead algorithm that requires work on the part of the operating system. On a page fault, the frame that has been in memory the longest is replaced.

Using FIFO algorithm implies that

a page which was brought into memory first will be removed first since variable was initialized very early. it is in the set of first in pages that will be removed.

It is the simplest page replacement algorithm. The operating system keeps track of all pages in the memory in a queue, the oldest page is in the front of the queue. When a page needs to be replaced page in the front of the queue is selected for removal that is first in first out.

A memory page containing a heavily used variable that was initialized very early and is in constant use is removed, then the page replacement algorithm used is called First In First Out.

7 0
2 years ago
Write a function called st_dev. St_dev should have one #parameter, a filename. The file will contain one integer on #each line.
kodGreya [7K]

Answer:

  1. import statistics
  2. def st_dev(file_name):
  3.    with open(file_name) as file:
  4.        data = file.readlines()
  5.        numList = []
  6.        for x in data:
  7.            numList.append(int(x))
  8.        
  9.        return statistics.pstdev(numList)
  10. print(st_dev("text1.txt"))

Explanation:

The solution code is written using Python.

To ease the calculation task, we can import Python statistics module to use the pstdev method to calculate the population standard deviation of a list of numbers (Line 1).

Next, create a st_dev function that take single argument file_name (Line 3). In the function, it will open the input file and read the data line by line (Line 4-5). Create a for loop to traverse through each line of the data which is an integer and append it to numList (Line 7-8). We can pass the numList to pstdev method (Line 10) and return the resulting standard deviation value as output.

We test the function by passing a file which hold a list of integer values in each line (Line 12).

8

9

12

11

21

15

16

10

7

13

And the output we shall get is 4.019950248448356

6 0
3 years ago
How do i set up a RAID 1 array?​
KiRa [710]

are you using windows? linux? mac?

3 0
3 years ago
What information is contained in the title bar
Varvara68 [4.7K]

Answer:

like the url i think

Explanation:

8 0
2 years ago
Which part of the software hierarchy is working behind the scenes allowing programs to perform tasks?
Svetradugi [14.3K]
The right answer for the question that is being asked and shown above is that: "Currently dispatched threads." The  part of the software hierarchy is working behind the scenes allowing programs to perform tasks is that <span>Currently dispatched threads</span>
5 0
3 years ago
Other questions:
  • In three to four sentences, describe why CEOs (the chief executive officers, that is, the leaders of large companies) make very
    9·1 answer
  • Which type of message format is designed to arouse curiosity, not showing the product or delivering quite enough information to
    10·1 answer
  • In the United States, everyone is guaranteed work true or false
    13·1 answer
  • A benefit of flashcards is that they are
    7·2 answers
  • Most wires are covered in rubber to insulate them and keep people safe from electricity and heat true of false
    11·1 answer
  • When backing up a database, what is added to the file name?<br> On g metrix
    9·1 answer
  • Opinion on sandshrew​
    13·1 answer
  • How are actual rocket launches similar to how balloon rockets and canister rockets launch?
    6·1 answer
  • How did technology change the world
    15·2 answers
  • This computer is used by touching your finger.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!