How to Define and Modulated a Code in Python - #First steps in Python part 8

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



Duration: 11:16
15 views
3


Today I learned a bit of Python, and how modulating your code can make your life so much easier and simple (as a programmer)
Basically, you can module your code, and that means that you can make multiple files contain different parts of the code (like the part were you define information or/and the part you process it) and just Define it as such, and import in the main code.
Defining a part of code is just making code "Compact" by defining a name to it, so here's an example:

def xtable(math)
for valor in range(1,10,1):
print(str(mult + " x " + str(value) + " = " + str((multvalue))

The code above is defining xtable the code below it, so every time I write xtable as a piece of code in my code it will produce the code below (which is a multiplication table from 1 to 10).
This doesn't just make the code shorter, it also makes changing it easier, since I can just modify the code 1 time (let's say to make a multiplication table go to 20) I just change the code below the def and all interactions of that code will also change.

and also I learned how to module my code, which is just:

from Directory.the_file import *

that imports def's from another file, so I can apply it in my main file, or the main module

The course I'm 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-10How to use Files in Python - #FirststepsinPython part 13
2021-06-10Como usar Arquivos em Python - #PrimeirospassoscomPythonparte 13
2021-06-08Como adicionar info em Dicionários em Python - #Primeiros passos com Python parte 12
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



Tags:
Programing
Programing Python
Python
Studying
Studying Programming
Studying Python
Learning
Learning Python
Learning Programming
Moduling
Moduling Code
Moduling Code Python
Def
Def code
Def code Python
Def Python
Defining
Defining Code
Defining Code Python