- Hands-On Data Science and Python Machine Learning
- Frank Kane
- 63字
- 2021-07-15 17:15:00
Negative syntax
One more thing you can do is have this negative syntax:
x[-2:]
The output is as follows:
[5, 6]
By saying x[-2:], this means that I want the last two elements in the list. This means that go backwards two from the end, and that will give me 5 and 6, because those are the last two things on my list.
推薦閱讀
- Unreal Engine Physics Essentials
- 數(shù)據(jù)庫系統(tǒng)教程(第2版)
- 國際大學(xué)生程序設(shè)計競賽中山大學(xué)內(nèi)部選拔真題解(二)
- C#編程入門指南(上下冊)
- AngularJS Web Application Development Blueprints
- Groovy for Domain:specific Languages(Second Edition)
- Monitoring Elasticsearch
- RabbitMQ Essentials
- LabVIEW虛擬儀器程序設(shè)計從入門到精通(第二版)
- Java Web應(yīng)用開發(fā)項目教程
- ASP.NET Web API Security Essentials
- C# 7.0本質(zhì)論
- 分布式數(shù)據(jù)庫HBase案例教程
- Joomla!Search Engine Optimization
- LabVIEW入門與實戰(zhàn)開發(fā)100例(第4版)