Level 1 : What are negative indexes in Python?


list=[1,2,3,4]
print(list[-1])

Author: Pavan | Tags: indexing | 1736+ Python FAQs | Share
generators-in-python | list-comprehension | docstring | filter-function | touples | mutable | namespace | precedence-and-associativity | bitwise | list-comprehension | python-django | data-structures | lambda-function | python-history | pickling-&-unpickling | while-else-loop | decorator | pep | print | mysql | factorial-function | expression | feature | parameter | copy | escape-operator | operator-and | sum() | pseudocode | dictionaries | counter-function | conversion | list-slicing | comprehension | objects | math-copysign | class-and-instance-variable | virtual-environment | mapping-function | postfix | condition | arithmetic-operation | complex-number | match | data-structure | regex | min-max-function | python | statement | assert | logical-operator | design-principle | counter | sys | list | swapping | implementation | function-argument | mathematics | virtual-environment | id-function | random-function | keyword | syntax-error | data_structure | indentation | library | string-formatting | oops | join | control-flow | overflow | basic | data-type | identifier | loop | error-handling | string-slicing | python-module | loop-control | input-function | classes | exception | module | max-min | loops | identity-operator | collections | global-keyword | destructor | yield | version-check | binary-operation | shallow-copy | access-modifier | staticmethod | array | global-variable | zip-function | import-method | gil | data-structure | decimal | functional-programming | identity-operator | benefit | memory | context-manager | file-handling | operator-overloading | command-line-parsing | string-concatenation | string-method | methods | math | dicts | class-and-object | round | def | heap-memory | zip | typeerror | memory-management | integer | control-flow | string-method | frozenset | dictionary | sum-function | function | raise | namedtuple | slicing | attribute | tuple-unpacking | list-indexing | fabs-function | class | comment | arithmetic-expression | static-method | regular-expression | __init_subclass__ | split | type-conversion | nested-loop | name-mangling | while-loop | sorted | file_handling | string-manipulation | recursion | center | __all__-attribute | binary | logical-operation | exception-handling | iterator | type-conversion | call | stack | global | python-repl | generator | list-operation | string-formatting | immutable-data-type | conditional-statement | format | string-iteration | goto-function | iterable | exponentiation | method | sys-module | string | thread | class-and-inheritance | conditional-statement | append | software-design | complex | for | bitwise-operator | threading | boolean-and-non-boolean | __future__ | string-slicing | recurssion | formal-and-actual-parameter | interpreter | syntax | matrix-list-comprehension | operator-or | list-join | constructor | oop | tuple | built-in-function | zfill-function | return-statement | init | built-in-function | encapsulation | mathematical-function | boolean | lambdas | object-attribute | floating-point-precision | bitwise-operator | operator | int | else-statement | python_version | precedence | print-statement | data-type | built-in | pandas | variable | round-function | input | range | multiprocessing | scientific-notation | operand | collection | generators | list-vs-tuple | matrix | global-variable | syntaxerror | lists | polymorphism | compute | with-statement | expand-tab | datatype | operators | error | input-function | exception-handling | default-mutable-argument | random | immutability | list-method | rollback | encoding | choice | set | package-management | version | update | magic-method | numeric | inherit | descriptors | higher-order-function | sorting | file | indexing | odd-number | debugging | matplotlib | lambda | type_conversion | assignment-operator | multithreading | multiple-inheritance | head-and-tail | syntax-error | filter | set-operation | application | asyncio | while-and-for-loop | logical-operator | numpy | control-statement | list-mutation | comparison | async | asyncio-module | function-and-scope | functions | installation | deep-copy | inheritance | turtle | map-function | invalid-list | enumerate() | datetime | file-handling | operations | slice | min-function ...