njdsbfjkc4992 njdsbfjkc4992
  • 23-01-2020
  • Computers and Technology
contestada

If the variable data refers to the string "No way!", then what does the expression data[-1] evaluate to

Respuesta :

flightbath flightbath
  • 23-01-2020

Answer:

'!'

Explanation:

In python, a string can be traversed from end very easily by using negative indexes, so, if index 0 points to the first element of the string, then, index -1 will point to the last element of the string, that is why, when data[-1] is printed last element of data, which is '!' is printed. Also, it can take more parameters separated by a colon, which are end index and step.

Answer Link

Otras preguntas

Three runners competed in a race data were collected at each mile mark for each runner If the runner ran at a constant paste the data would be linear a regressi
what does 5 degree & 8 degree equal
find the value of x in this screenshot
if a liter of water is heated from 20 degrees celsius to 50 degrees celsius, what happenes to its volume? a. the volume increases b. the volume decreases c. t
Identify the term character development
At the clothing store, 1/8 of the clothes are shirts. Of the shirts 1/4 are green. What fraction of the clothing in the store are green shirts?​
Do yall like chicken :3 also what is 2+2?
The points D(-9,8) and E(3,-13) are on a coordinated plane. What is the approximate distance between points D and E?
The length of the unknown leg of the right triangle is? I’ll mark u as brainlist
Which was the original agreement of the Munich Conference? O Hitler would gain control of Sudetenland and Czechoslovakia. O Hitler would gain control of Sudeten