У нас вы можете посмотреть бесплатно Python Tutorial for Beginners - Python List Comprehension - Python List Creation или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Descargar el Código: patreon.com/pythonmaraton Join Patreon: patreon.com/pythonmaraton ^Downloadable code & more! This video shows some examples of how to make lists in python in one line using list comprehension. You can use for loops and if statements inside of list creation to create large lists in one line. This tutorial is done in ipython. This is a Python anaconda tutorial for help with coding, programming, or computer science. These are short python videos dedicated to troubleshooting python problems and learning Python syntax. For more videos see Python Help playlist by Master Python Rylan Fowers. ✅Subscribe: / @pythonmaraton 📺Channel: / @pythonmaraton ▶️Watch Latest Python Content: • Python String Slice and List Slice ▶️Watch Latest Other Content: • Видео LIST COMPREHENSION This video will show you how to make large lists in one line with a few examples In the first example we define our list with brackets and then type a mini loop for x in range(0,10) This will give 0 through 9 since it includes the first number but not the last in the range IN this next example we show you the same thing but with negative numbers. We will end the range at 11 to include positive 10 Here is the print out Next we will include an if statement inside our list comprehension. We will say if x mod 2 is equivalent to 0. This puts numbers in the list that are even, or divisible by 2 Next we will do an if statement and include and else clause. Let’s say if x mod 2 and else do x squared. This will print all the numbers in the range and square each one that is equivalent to 0 mod 2. So 2 squared is 4, 3, then 4 squared is 16 and 5, and 6 squared is 36 and so on IN this last example we will use an inequality with our if statement. So if our x is greater than or equal to 0 we will keep it, else we replace it with a 1. Here is the print out There you have it, that is an introduction of how you do python list comprehension. #PythonMarathon #LearnPython #PythonTutorial