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

write an expression that equals 5
The scientific evidence that scientists use in supporting or critiquing the conclusions of experiments usually consists of raw data. outlier data precise data s
8. By Remainder Theorem find the remainder, when p(x) is divided by g(x), whereO P(x) = x-2 -4-1, 8(x) = x + 1(i) P(x) = x - 3x² + 4x + 50. g(x)=x-3​
8) Describe Karl Marx and Friedrich Engels' THREE main points in the Communist Manifesto.​
azolla is a a bryophyta b algaec fungusd water fern​
4 x the third power of ten
Any of #13-16 please?!
2. Point A is located at (-8, -3) on the coordinate grid. If it is shifted two units to the right and nine units up, what are the coordinates of its new locatio
How do u solve 50=pi*2(h+3)
10[tex]30 \times 400[/tex]​