lexiepedit208 lexiepedit208
  • 13-01-2020
  • Mathematics
contestada

Slice indices must be integers or none or have an __index__ method

Respuesta :

ibnahmadbello
ibnahmadbello ibnahmadbello
  • 19-01-2020

Answer:

This is an error (TypeError) that is displayed by the Python interpreter when one of the parameter in a slice function is not a value of type integer or None.

For example:

>>> a = 'welcome'

>>> a[2.2:3]

Traceback (most recent call last):

 File "<stdin>", line 1, in <module>

TypeError: slice indices must be integers or None or have an __index__ method

The error occur because the value 2.2 is not an integer or None

Step-by-step explanation:

Answer Link

Otras preguntas

What is the equation, in slope-intercept form, of the line that passes through (0,3) and has a slope of -6?
How did improved transportation affect farming?
if a area of a rectangle is 24,396 centimeters and if width is 38 centimeters what is length?
7.954 rounded to the nearest hundredths
88 students for 4 classes?
round 672,831 to the nearest ten thousand
What is the sum of 2.5 × 104 and 3.4 × 104
A DVD player costs $99.99. For the next two weeks, the DVD player will be on sale for 20% off. What is the amount of the discount rounded to the nearest penny?
Which goal was shared by the women's rights movement and the Civil Rights movement? court decisions to end segregation expanded economic opportunities passage o
is this true or false? Complex medical devices must be proven safe before the FDA will allow them to be sold in the US.