Skip to content

Latest commit

 

History

History

0x02-python-import_modules

Python - import & modules

Technologies

  • Files written in vi, vim, and emacs editors.
  • Files tested on Ubuntu 20.04.
  • Python3.4 files .
  • Files Checked using betty-style.pl and betty-doc.pl.

Files

Files Description/Question
0-add.py Write a program that imports the function def add(a, b): from the file add_0.py and prints the result of the addition 1 + 2 = 3
1-calculation.py Write a program that imports functions from the file calculator_1.py, does some Maths, and prints the result.
2-args.py Write a program that prints the number of and the list of its arguments.
3-infinite_add.py Write a program that prints the result of the addition of all arguments: The output should be the result of the addition of all arguments, followed by a new line. You can cast arguments into integers by using int() (you can assume that all arguments can be casted into integers). Your code should not be executed when imported.
4-hidden_discovery.py Write a program that prints all the names defined by the compiled module hidden_4.pyc (please download it locally).
5-variable_load.py Write a program that imports the variable a from the file variable_load_5.py and prints its value.
100-my_calculator.py Write a program that imports all functions from the file calculator_1.py and handles basic operations.
101-easy_print.py Write a program that prints #pythoniscool, followed by a new line, in the standard output.
102-magic_calculation.py Write the Python function def magic_calculation(a, b).
103-fast_alphabet.py Write a program that prints the alphabet in uppercase, followed by a new line. Your program should be maximum 3 lines long. You are not allowed to use: any loops, any conditional statements, str.join(), any string literal
add_0.py A module prototype for add function.
calculator_1.py A module prototype for calculation function.
easy_print_101.py A module prototype for easy_print function.
fast_alphabet_103.py A module prototype for fast_alphabet function
variable_load_5.py A module prototype for variable_load function