O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Python : Modules and Packages

Briache Issam Inglês

Python : Modules and Packages

Conteúdo do mapa

Python : Modules and Packages

  1. Python Modules

    • The Modules in Python ar just some fils with .py Extension
      • In these fils we can write any Python code and excute it from the main Python file
        • To do that we use """import ModulsName""" and ModulsName..functionsName()
          • If we want to call these functions whithout using the ModulsName we write: from ModulsName import FunctionsName
            • Look at this Explaining Example
  2. Python Packages

    • We use Packages to group or combine different Modules into one file
      • Like the Modules ,Packages containe files with some code to execute in the main Python file
        • it's necessary to add a file named""__init__ .py"",this is the initialization Python file, it allows us to import the whole folder
          • also in packages, we use """from Package'sName import Module'sName""" and Modul'sName..Function'sName()
            • Look at this explaining Example
  3. Some Built-in Modules in Python

    • Random Modules
      • Random() : Gives a random number between 0.0 and 1.0
      • Randint("Start number","End number") : Gives a random integer number in a given range
      • randrange("Start number","End number","Step") : Gives a random number in a range using a specific number of steps
      • Uniform("Start float number","End Float number") : Gives a random float number in a range
      • shuffle(Sequence'sName) : Reorder the list items arbitrarly
      • choice(Sequence'sName) : choice a random item from a list or a tuple or a set
      • sample(Sequece'sName , number_of_items) : choice a number of items randomly
    • Date and Time Modules
      • datetime..now() : Gives the current date with the hour, nminutes and seconds
      • date..today() : Gives the current date with the year, month, and day
      • We can use the atributes : year, month, day ,hour,minute,second to print the year,month,day,hour,monute,or second
      • if we want to print a specific date we use datetime(year,month,day,hour,minute,second)
      • use total_seconds to know how many seconds in a date
    • Look at this Explaining Exampe
    • Look at this Explainong Example

Imagens e arquivos do mapa

  • Python : Modules and Packages
  • Python : Modules and Packages
  • Python : Modules and Packages
  • Python : Modules and Packages

Informações

Descrição
Mapa Mental sobre Python : Modules and Packages, criado por Briache Issam em 20-08-2021.
Criado por
Briache Issam
Visualizações
1
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?