5 (4)

5 (4)

#### Overview of this book

Welcome to the Robot World … and start building intelligent software now! Through his best-selling video courses, Hadelin de Ponteves has taught hundreds of thousands of people to write AI software. Now, for the first time, his hands-on, energetic approach is available as a book. Starting with the basics before easing you into more complicated formulas and notation, AI Crash Course gives you everything you need to build AI systems with reinforcement learning and deep learning. Five full working projects put the ideas into action, showing step-by-step how to build intelligent software using the best and easiest tools for AI programming, including Python, TensorFlow, Keras, and PyTorch. AI Crash Course teaches everyone to build an AI to work in their applications. Once you've read this book, you're only limited by your imagination.
Preface
Free Chapter
Welcome to the Robot World
Discover Your AI Toolkit
Python Fundamentals – Learn How to Code in Python
AI Foundation Techniques
Your First AI Model – Beware the Bandits!
AI for Sales and Advertising – Sell like the Wolf of AI Street
Welcome to Q-Learning
AI for Logistics – Robots in a Warehouse
Going Pro with Artificial Brains – Deep Q-Learning
AI for Autonomous Vehicles – Build a Self-Driving Car
AI for Business – Minimize Costs with Deep Q-Learning
Deep Convolutional Q-Learning
AI for Games – Become the Master at Snake
Recap and Conclusion
Other Books You May Enjoy
Index

# Lists and arrays

Lists and arrays can be represented with a table. Imagine a one-dimensional (1D) vector or a matrix, and you have just imagined a list/array.

Lists and arrays can contain data in them. Data can be anything – variables, other lists or arrays (these are called multi-dimensional lists/arrays), or objects of some classes (we will learn about them later).

For example, this is a 1D list/array containing integers:

And this is an example of a two-dimensional (2D) list/array, also containing integers:

In order to create a 2D list, you have to create a list of lists. Creating a list is very simple, just like this:

``````L1 = list()
L2 = []
L3 = [3,4,1,6,7,5]
L4 = [[2, 9, -5], [-1, 0, 4], [3, 1, 2]]
``````

Here we create four lists: `L1`, `L2`, `L3` and `L4`. The first two lists are empty – they have zero elements. The two subsequent lists have some predefined values in them. `L3` is a one-dimensional list, same as the one in the...