Level 1 : What are negative indexes in Python?


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

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