Level 1 : What are negative indexes in Python?


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

Author: Pavan | Tags: indexing | 1859+ Python FAQs | Share
list-join | complex | higher-order-function | generators | set | touples | walking-through-directories-using-os.walk() | creating-custom-modules | zfill-function | debugging | control-statement | directory-operations | threading | thread-synchronization | return-statement | using-else-and-finally | introduction-to-threads | creating-and-starting-threads | odd-number | precedence | control-flow | python-django | oop | datatype | list-comprehension | string-slicing | split | time-series-with-pandas | match | lambda-functions | string-method | fabs-function | else-statement | recurssion | logical-operation | slice | managing-directories-with-os-and-shutil | python-syntax-and-structure | default-mutable-argument | recursion | object-attribute | data-types | introduction-to-python | virtual-environment | design-principle | decimal | counter-function | defining-functions | while-else-loop | file-handling | oops | function-and-scope | heap-memory | key-value-pairs | tuple | formatting-with-strftime | floats | list-methods-and-slicing | sys-module | dictionary-comprehensions | indentation | filter-function | statement | software-design | destructor | logical-operator | difference-between-threads-and-processes | print-statement | logical-operator | string-iteration | complex-number | raise-statement | loop-control | intering | string-methods | import-method | format | implementation | parameter | round | aggregating-data-with-functools.reduce() | dicts | unit-testing | encapsulation | yield | filter | mathematical-function | sys | anchors-(^,-$) | rollback | mutable | data-structures | using-map()-for-transformations | regular-expression | python-operators | operations | benefit | regular-expressions | list-vs-tuple | lambda-function | turtle | set-operation | methods | identity-operators-(is,-is-not) | syntax-error | namespace | identifier | overflow | pseudocode | data-structure | polymorphism | arithmetic-expression | staticmethod | id-function | datetime.date,-datetime.time,-datetime.datetime | type-conversion-and-casting | inherit | random | version | arithmetic-operation | data-type | tuple-unpacking | zip | pass | string-concatenation | matrix | list | list-slicing | working-with-temporary-files-using-tempfile | class-and-object | docstring | working-with-dates-and-times | with-statement | using-os-and-pathlib-modules | swapping | string-formatting | multiple-except-blocks | installation | copy | input | conditional-statement | iterable | scientific-notation | arbitrary-arguments-(*args,-**kwargs) | class-and-inheritance | while-and-for-loop | module | introduction-to-multiprocessing | range | bitwise | identity-operator | interpreter | string-slicing | virtual-environment | sorted | list-indexing | dictionaries | python | operator-and | class | overriding-methods | list-comprehensions | list-operation | sorting | integers | dictionary-methods | lists | generators-in-python | else | reading-and-writing-files | expand-tab | gil | pandas | def | head-and-tail | shallow-copy | command-line-parsing | variable | error-handling | math | operator-overloading | why-use-multiprocessing-over-threading?-(gil) | sets | center | string-method | mysql | numpy | quantifiers-(*,-+,-?,-{}) | collections | nested-loop | generator | slicing | python-module | multithreading | static-method | array | class-and-instance-variable | comprehension | pep | comment | for | stack | handling-missing-values-(fillna,-dropna) | control-flow | conditional-statement | syntax-error | inheritance | while-loop | int | built-in-function | version-check | input-function | booleans | multiple-inheritance | mathematics | condition | asyncio-module | immutable-data-type | matplotlib | random-function | default-arguments | invalid-list | conversion | reading:-read(),-readline(),-readlines() | list,-set,-and-dictionary-comprehensions | min-function | functional-programming | sum-function | namedtuple | map-function | working-with-file-paths | round-function | immutability | exception-handling | global | tuple-methods | built-in | type-conversion | dictionary | decorator | built-in-modules | while-loops | opening-files-(open()) | using-join()-and-is_alive()-methods | access-modifier | thread-safe-data-structures-(queue.queue) | loop-control-statements | function | exception-handling | boolean-and-non-boolean | print | max-min | lambda | using-assertions-(assertequal,-assertraises) | working-with-binary-files-(rb,-wb) | expression | multiprocessing | list-mutation | python-history | data_structure | list-comprehension | exponentiation | library | boolean | classes | string-manipulation | zip-function | datetime | type_conversion | method-overloading | data-type | exception | matrix-list-comprehension | literal-characters-and-special-characters | __all__-attribute | loop | operator-or | string-formatting | encoding | application | thread | single-inheritance | using-yield-in-functions | memory-management | iterator | sum() | indexing | writing:-write(),-writelines() | numeric | indexing:-loc-vs-iloc | function-argument | multiple-inheritance | precedence-and-associativity | raise | operators | operator | conditional-statements | update | deep-copy | error-handling | membership-operators-(in,-not-in) | reading-and-writing-large-files-efficiently | test-discovery | string | global-variable | keyword | __future__ | bitwise-operator | regex | syntax | typeerror | python-repl | assignment-operators | syntaxerror | name-mangling | floating-point-precision | list-method | using-the-threading-module | dataframe-and-series-objects | append | constructor | built-in-function | error | math-copysign | memory | comparison | escape-operator | python_version | identity-operator | tuples | using-lists-as-stacks | functional-programming | class-decorators | loops | joining-and-merging-dataframes | parsing-with-strptime | operand | input-function | init | filtering-and-indexing | binary-operation | method | call | objects | lambdas | sorting-and-ranking | strings | counter | enumerate() | mapping-function | advanced-file-operations | logical-operators | join | integer | package-management | type-conversion | magic-method | min-max-function | postfix | file_handling | descriptors | iterators | goto-function | factorial-function | boolean-masking | choice | __init_subclass__ | file | file-handling | async | bitwise-operator | data-structure | global-keyword | global-variable | assert | collection | feature | assignment-operator | formal-and-actual-parameter | frozenset | basic | asyncio | binary | data-type-conversions | attribute | data-structures-in-python | compute | context-manager | functions | pickling--unpickling ...