Skip to content

Joshua7792/holbertonschool-higher_level_programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

379 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Exercises

This repository contains exercises and projects for the Python programming language. The exercises are organized into three folders:

python-hello_world

The python-hello_world folder contains exercises related to basic Python syntax and programming concepts. These exercises include:

  • 2-print.py: A script that prints a specific string to the console.
  • 3-print_number.py: A script that prints a specific number to the console.
  • 4-print_float.py: A script that prints a specific float to the console.
  • 5-print_string.py: A script that prints a specific string with special characters to the console.
  • 6-concat.py: A script that concatenates two strings and prints the result to the console.
  • 7-edges.py: A script that prints specific substrings of a string to the console.
  • 8-concat_edges.py: A script that concatenates specific substrings of two strings and prints the result to the console.
  • 9-easter_egg.py: A script that prints a specific string with an Easter egg to the console.

python-if_else_loops_functions

The python-if_else_loops_functions folder contains exercises related to control flow statements, loops, and functions in Python. These exercises include:

  • 0-positive_or_negative.py: A script that generates a random number and prints whether it is positive, negative, or zero.
  • 1-last_digit.py: A script that generates a random number and prints whether its last digit is greater than 5, less than 6 but not 0, or 0.
  • 2-print_alphabet.py: A script that prints the alphabet in lowercase using a loop.
  • 3-print_alphabt.py: A script that prints the alphabet in lowercase, except for the letters "q" and "e".
  • 4-print_hexa.py: A script that prints the numbers from 0 to 98 in decimal and hexadecimal format.
  • 5-print_comb2.py: A script that prints all possible combinations of two digits.
  • 6-print_comb3.py: A script that prints all possible combinations of three digits.
  • 7-islower.py: A function that checks whether a given character is lowercase.
  • 8-uppercase.py: A function that converts a string to uppercase.
  • 9-print_last_digit.py: A function that prints the last digit of a given number.
  • 10-add.py: A function that adds two numbers and returns the result.
  • 11-pow.py: A function that calculates the power of a given number.
  • 12-fizzbuzz.py: A function that prints the numbers from 1 to 100, replacing multiples of 3 with "Fizz", multiples of 5 with "Buzz", and multiples of both with "FizzBuzz".
  • 100-print_tebahpla.py: A script that prints the alphabet in reverse order, alternating between uppercase and lowercase letters.
  • 101-remove_char_at.py: A function that removes a character at a given position from a string.
  • 101-main.py: A script that tests the 101-remove_char_at.py function.
  • 11-main.py: A script that tests the 11-pow.py function.
  • 10-main.py: A script that tests the 10-add.py function.
  • 9-main.py: A script that tests the 9-print_last_digit.py function.
  • 8-main.py: A script that tests the 8-uppercase.py function.
  • 7-main.py: A script that tests the 7-islower.py function.
  • 6-print_comb3.py: A script that tests the 6-print_comb3.py script.
  • 5-print_comb2.py: A script that tests the 5-print_comb2.py script.
  • 4-print_hexa.py: A script that tests the 4-print_hexa.py script.
  • 3-print_alphabt.py: A script that tests the 3-print_alphabt.py script.

Note that the __pycache__/ directory contains compiled bytecode files that Python generates to improve the performance of importing modules. You can safely ignore this directory.

python-import_modules

The python-import_modules folder contains exercises related to importing and using modules in Python. These exercises include:

  • 0-add.py: A script that imports a function from add-0 and uses it to add two numbers.
  • 1-calculation.py: A script that imports functions from a module and uses them to perform various calculations.
  • 2-args.py: A script that prints the arguments passed to it using the sys module.
  • 3-infinite_add.py: A script that adds any number of positive integers passed to it as arguments.
  • 4-hidden_discovery.py: A script that prints all the names defined in a module that do not start with "__".
  • 5-variable_load.py: A script that imports a variable from a module and prints its value.
  • 100-my_calculator.py: A script that imports all functions from a module and uses them to perform various calculations.
  • 101-easy_print.py: A script that prints a specific string to the console using the sys module.
  • 102-magic_calculation.py: A Python function that replicates the following Python bytecode:
  3           0 LOAD_CONST               1 (98)
              3 LOAD_FAST                0 (a)
              6 LOAD_FAST                1 (b)
              9 BINARY_POWER
             10 BINARY_ADD
             11 RETURN_VALUE
  • 103-fast_alphabet.py: A script that prints the alphabet in uppercase without using loops, conditional statements, string literals, or system calls.

python-data_structures

The python-data_structures repository contains exercises related to data structures in Python. These exercises include:

  • 0-print_list_integer.py: A script that prints all integers of a list.
  • 1-element_at.py: A function that retrieves an element from a list like in C.
  • 2-replace_in_list.py: A function that replaces an element of a list at a specific position.
  • 3-print_reversed_list_integer.py: A script that prints all integers of a list, in reverse order.
  • 4-new_in_list.py: A function that replaces an element in a list at a specific position without modifying the original list.
  • 5-no_c.py: A function that removes all characters c and C from a string.
  • 6-print_matrix_integer.py: A function that prints a matrix of integers.
  • 7-add_tuple.py: A function that adds 2 tuples.
  • 8-multiple_returns.py: A function that returns a tuple with the length of a string and its first character.
  • 9-max_integer.py: A function that finds the biggest integer of a list.
  • 10-divisible_by_2.py: A function that finds all multiples of 2 in a list.
  • 11-delete_at.py: A function that deletes the item at a specific position in a list.
  • 12-switch.py: A function that switches the values of two variables.

Note that the __pycache__/ directory contains compiled bytecode files that Python generates to improve the performance of importing modules. You can safely ignore this directory.

Author

Joshua Santiago

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors