In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you an example analysis of the creation of Python data structures, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
1. List list: variable assignment method: shoplist = ['apple',' mango', 'carrot',' banana']
two。 Tuple array: variable assignment method: zoo = ('wolf',' elephant','penguin')
3. Dictionary dict: variable assignment method: d = {key1: value1, key2: value2}
4. Sequences: lists, tuples, and strings are all sequences
(1) Index operator: gets a character of an element or string in a list / tuple
(2) slice operator: get a slice of a sequence, consecutive elements / characters
(3) eg:
Name = 'swaroop' print' characters 0 is', name [0]
Slots, index operator, similar to C #
Print 'characters 1 to 3 is', name [1:3]
'The wa' slicing operator, similar to the Substring method in C#
In fact, Python contains a lot of content, such as Python is different from the traditional interpreted scripting language, it will be compiled into bytecode when it is executed * *, and then the bytecode will be run directly. This .NET DLR is a bit similar to Java's virtual machine, in short, it is a way to convert the code closer to machine code, which can improve performance.
Many people say that Python,Ruby is a working language and Java is a weekend language. In fact, languages communicate with each other. If you learn more, you can broaden your horizons. It is also a guarantee to choose one of them to learn when agile development is so hot, isn't it? If you touch Python, I'm sure you'll like it.
The above is a sample analysis of the creation of Python data structures. have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.