python There are two ways of indexing . From left to right , Subscript from 0 Start ; From right to left , Subscript from -1 Start .

python There are six types of data :

  • Immutable data ( four ):Number( Numbers )、String( character string )、Tuple( Tuples )、Sets( aggregate );
  • Variable data ( Two ):List( list )、Dictionary( Dictionaries ).

List List is written in [] in . Tuples (tuple) Like a list , The difference is that the elements of a tuple cannot be modified . Tuples are written in parentheses  ()  in , The elements are separated by commas . The element types in tuples can also be different .

although tuple The element of cannot be changed , But it can contain mutable objects , such as list list .

Dictionary values can be anything python object , It can be a standard object , It can also be user-defined , But the key doesn't work .

Two important points to remember :

1) The same key is not allowed to appear twice . When creating, if the same key is assigned twice , The latter value will be remembered .

2) The key must be immutable , So you can use numbers , A string or tuple acts as , Not with lists .

python Study : More articles on data types

  1. python Study - data type

    The data processed by a computer is not just numbers , Computers can process numbers . Text . Audio . Video and all kinds of data , What is described below is Python Basic data types that can be used and processed directly in .     Integers Python Can handle integers of any size , Follow ja ...

  2. python Study Sequence of data types

    One . Sequence ( This article USES the python3.5)############################################################# list . Tuples Characters are all sequences # characteristic :#1 ...

  3. Python Learn basic notes ( whole )

    Change blogs , still csdn Better . Python Learn basic notes 1.Python Study -linux Next Python3 Installation 2.Python Study - data type . Operator . Conditional statements 3.Python Study - Loop statement 4. ...

  4. python Learn Lesson 9 ,python Data types in , The use and introduction of string

    Catalog python Learn Lesson 9 ,python Data types in , The use and introduction of string A string 1. Definition of string 2. Common operation of string 3. String manipulation len count index operation 4. Judge white space characters , sentence ...

  5. python Learn Lesson 8 ,python Data types in , list , Yuan Zu , Dictionaries , The use and introduction of the dictionary

    Catalog python Learn Lesson 8 ,python Data types in , list , Yuan Zu , Dictionaries , The use and introduction of the dictionary .md Dictionary 1. Dictionary definition 2. The use of dictionaries . 3. Common ways of Dictionary . python Learn Lesson 8 ,python ...

  6. python Learn lesson seven ,python Data types in , list , Yuan Zu , Dictionaries , The use and introduction of Yuanzu

    Catalog python Learn lesson seven ,python Data types in , list , Yuan Zu , Dictionaries , The use and introduction of Yuanzu First, Yuanzu 1. About Yuanzu 2. The definition of Yuanzu variable 3. The common operations of Yuanzu variables . 4. The traversal of Yuanzu 5. Yuanzu's application scenarios p ...

  7. python Learn Lesson 6 ,python Data types in , list , Yuan Zu , Dictionaries , Use and introduction of the list

    Catalog python Learn Lesson 6 ,python Data types in , list , Yuan Zu , Dictionaries , Use and introduction of the list . 2. List , Other languages are called arrays 1. Definition of list , And grammar 2. Use of lists , And common methods . 3. Common operations of list ...

  8. python Study diary ( Basic data types and their methods 01)

    Numbers int It's mainly for calculation , There is a common method # When decimal value is expressed in binary system , The minimum number of digits to use i = 3#3 Of ASCII by :0000 0011, That's two s = i.bit_length() print ...

  9. python Learning notes -- data type

    Life is short, You need Python! Aggressive slogan ! Today I also began to learn python 了 , After all, the front end that doesn't understand the back end is not a good front end . There was... Before ‘ The best language in the world ’ and JavaScript Learning experience . ...

  10. Python Learning notes (1)——Python Overview (Python Environment 、 Variable 、 data type 、 Basic operation )

    Table of Contents 1. Python summary 1.1. Python Basic knowledge of 1.2. Running environment 1.3. Python The format of 1.4. Python The variable of . 2. Python Data class of ...

Random recommendation

  1. 【 Dry cargo sharing 】 technological process DEMO- Go out and apply

    Process name :  Go out and apply    Process related documents :  Process pack .xml   Process description :  Import the process package file directly , You can use this process    Forms :    technological process : picture :2.png DEMO Package download : http://files.cnblog ...

  2. DOS The use of command Appenders

    @echo off start \\192.168.10.120\ Common software \ System tools \ Remote client \winvnc.exe # Open the shared remote client program ipconfig /all > d:\disp ...

  3. HttpResponse Of Close and End difference

    Reprinted from :http://blog.sina.com.cn/s/blog_702c390c0100mlhi.html Recently, it was launched IIS Compression function on , But a module on the test system becomes unavailable . This module adopts AJAX technology ...

  4. HDU1711-----Number Sequence----- Naked KMP

    Title address :http://acm.hdu.edu.cn/showproblem.php?pid=1711 The title mean : find b stay a Starting position in , If not, it is -1 Their thinking : Naked KMP, Not much to say Can't KMP Words ...

  5. Automatic generation makefile Script for

    If you need to test a feature , Wrote a test.cpp One day, another utils.cpp, And so on , More and more test files Maintain one manually every time you test makefile It's really unwise So the idea of automatic maintenance with scripts came into being ...

  6. SQL Server Table partition details

    original text :SQL Server Table partition details What is table partitioning In general , When we build database tables , Table data is stored in a file . But if it's a partition table , Table data will be divided into different files according to the rules you specify , Take a big data file apart ...

  7. Android Development ——ListView Use skill summary ( Two )

    0.  Preface Android Medium ListView Is one of the more used controls , In the last article Android Development --ListView Use skill summary ( One ) Chinese vs ListView Of ViewHolder Mechanism . Optimize the Caton mode and ...

  8. Dynamic addition select The problem of empty options

    problem : When dynamically adding data for campus options , Always add one more blank item of data . The dynamic addition code is as follows : Reasons found online : Because in option There's a label in it that's not closed , So the browser thinks it's two option, So just add... To this tag ...

  9. KBMMW 4.84.00 Release

    kbmMW is a portable, highly scalable, high end application server and enterprise architecture integr ...

  10. obtain platformVersion、deviceName、appPackage

    The command gets the following : The mobile phone is connected to the computer devicename:    adb devices platformversion :   adb shell getprop ro.build.version.re ...