amy8989
amy8989 amy8989
  • 07-12-2020
  • Computers and Technology
contestada

WHAT WILL BE THE OUTPUT OF THE FOLLOWING

S="PYTHO LANG"

print(S[5::-1])

print(S[5:])

print(S[-6:-1:2])

PLEASE ANSWER FAST

Respuesta :

mrsaini281 mrsaini281
  • 07-12-2020

Answer:

OHTYP

LANG

OLN

Explanation:

1) print(S[5::-1]) will go to the 5th character and -1 will reverse all the back.

Python so 5th word is n and -1 will reverse this word to nohtyp.

2) print(S[5:]) has just 5. It means it just read the word after 5th word. and we have no other argument so we will get output Lang.

Answer Link

Otras preguntas

Which compound is an alcohol? (1) propanal (3) butane (2) ethyne (4) methanol
Which governmental body did Napoleon Bonaparte overthrow in 1794 after Robespierre's execution? A. National Assembly B. Third Estate C. the Directory D. Nationa
Alice travels 3 times faster than Brenda. Traveling in opposite directions, they are 720 miles apart after 7.5 hours. Find their rates of travel.
What are 10 good and bad adjectives to describe Napoleon?
what were some of the conditions that soldiers on the front lines had to face
Which element is a noble gas? (1) krypton (3) antimony (2) chlorine (4) manganese
is 74.3 greater or less than 7.43
Precipitation reactions: Hg(NO3)2(aq) +Na2CrO4(aq) = _________ (aq) + NaNO3 (s)
is 74.3 greater or less than 7.43
Which of the following factors is not used in calculating the specific heat of a substance? A. mass B. temperature change C. heat required for a temperature cha