Create a Python program that will produce the following output:
Given the following sentence, print out

every third letter.
The Python programming language makes manipulating strings very easy!

Respuesta :

Answer:

def main ():

   sentence = input("Please enter a sentence:")

   print("Original Sentence:",sentence)

   # start at the third character

   for i in range(2,  len(sentence), 3):

       # access the string by index  

       print("Every third letter:", sentence[i])

Explanation:

def helps define the sentence ( input)

in order to start printing from third letter we start the range from 2 and keep the step 3 . The range i is in square parenthesis to show the range and access string.

ACCESS MORE