How to Search and Modify Lists in Python - #First steps in Python part 7

Subscribers:
2,490
Published on ● Video Link: https://www.youtube.com/watch?v=kRmEKDuSqik



Category:
Tutorial
Duration: 15:23
7 views
2


Today I learned a bit of Python, and how I can modify lists in my code!
The ideia is modifying my lists and variables while the code is running, and not manually , so here is an exemple:
PriceLowering=input("\nType the Name of the product that must have a lower price : ")
for Product in inventory:
if PriceLowering==Product[0]:
print("Old Price: ", Product[1])
Product[1] = Product[1] * 0.9
print("New Price: ", Product[1])

in this short code, I take a List and modify one of it's contents that I myself define, and then make it's price 10% lower by multiplying it by 0.9.
This is used everywhere since things are constantly changing, and having the ability to change that just by typing it, instead of needing to stop, find the variable where the contents are, change it, and run the code again.

The course I am using(it's in Portuguese): https://on.fiap.com.br/local/salavirtual/conteudo-digital.php

If you have any question or suggestion on other topics, feel free to comment down below or ask me in Facebook or Instagram!

Visit my Facebook Page in: http://fb.com/teteusbionicoficial
Visit my Instagram: https://www.instagram.com/teteusbionic/
Visit my Website: http://www.teteusbionic.com.br




Other Videos By Teteus Bionic (Teteus Bionic)


2021-06-08How to add info to Dictionaries in Python - #First steps in Python part 12
2021-06-03How to use Dictionaries to Store Information in Python - #First steps in Python part 11
2021-06-03Como usar Dicionários para Armazenar Informação em Python - #Primeiros passos com Python parte 11
2021-05-27Como usar Dicionários em Python - #Primeiros passos com Python parte 10
2021-05-27How to use Dictionaries in Python - #First steps in Python part 10
2021-05-26The Difference between Lists and Definitions - #First steps in Python part 9
2021-05-26A Diferença entre Listas e Definições - #Primeiros passos com Python parte 9
2021-05-21How to Define and Modulated a Code in Python - #First steps in Python part 8
2021-05-21Como Definir e Modular Código em Python - #Primeiros passos com Python parte 8
2021-05-20Como Procurar e Modificar Listas em Python - #Primeiros passos com Python parte 7
2021-05-20How to Search and Modify Lists in Python - #First steps in Python part 7
2021-05-18Como ler LISTS com Python - #Primeiros passos com Python - 6
2021-05-18How to use and read LISTS in Python - #First steps in Python 6
2021-05-17Como usar LISTAS com Python - #Primeiros passos com Python parte - 5
2021-05-17How to use Lists in Python - #First steps in Python 5
2021-05-13How to use In Range in Python - #First steps in Python 3
2021-05-13Como usar In Range com Python - #Primeiros passos com Python parte - 4
2021-05-12Como usar Elif e While com Python - #Primeiros passos com Python parte - 3
2021-05-12How to use Elif and While in Python - #First steps in Python 2
2021-05-03Kinetic energy is the most common energy
2021-05-03A energia Cinética é a Energia Mais Comum



Tags:
Programing
Programing Python
Python
Studying
Studying Programming
Studying Python
Learning
Learning Python
Learning Programming
Lists
Programming Lists
Python Lists
Modifying Lists
Modifying Python Lists