Skip to content

Latest commit

 

History

History

0x01-python-if_else_loops_functions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Project: 0x01. Python - if/else, loops, functions

This directory contains projects focused on understanding and implementing control flow tools in Python. The tasks cover concepts such as if/else statements, loops, functions, and handling various Python-specific features.

Resources

Read or watch

Learning Objectives

General

  • Why Python programming is awesome
  • Why indentation is so important in Python
  • How to use the if, if ... else statements
  • How to use comments
  • How to assign values to variables
  • How to use the while and for loops
  • How is Python’s for different from C‘s?
  • How to use the break and continue statements
  • How to use else clauses on loops
  • What does the pass statement do, and when to use it
  • How to use range
  • What is a function and how do you use functions
  • What does return a function that does not use any return statement
  • Scope of variables
  • What’s a traceback
  • What are the arithmetic operators and how to use them

Tasks

Task File Description
0. Positive anything is better than negative nothing 0-positive_or_negative.py Write a script that assigns a random signed number to the variable number each time it is executed and prints whether the number is positive, negative, or zero.
1. The last digit 1-last_digit.py Write a script that assigns a random signed number to the variable number each time it is executed and prints the last digit of the number.
2. I sometimes suffer from insomnia. And when I can't fall asleep, I play what I call the alphabet game 2-print_alphabet.py Write a program that prints the ASCII alphabet, in lowercase, not followed by a new line.
3. When I was having that alphabet soup, I never thought that it would pay off 3-print_alphabt.py Write a program that prints the ASCII alphabet, in lowercase, except q and e, not followed by a new line.
4. Hexadecimal printing 4-print_hexa.py Write a program that prints all numbers from 0 to 98 in decimal and in hexadecimal.
5. 00...99 5-print_comb2.py Write a program that prints numbers from 0 to 99.
6. Inventing is a combination of brains and materials. The more brains you use, the less material you need 6-print_comb3.py Write a program that prints all possible different combinations of two digits.
7. islower 7-islower.py Write a function that checks for lowercase character.
8. To uppercase 8-uppercase.py Write a function that prints a string in uppercase followed by a new line.
9. There are only 3 colors, 10 digits, and 7 notes; it's what we do with them that's important 9-print_last_digit.py Write a function that prints the last digit of a number.
10. a + b 10-add.py Write a function that adds two integers and returns the result.
11. a ^ b 11-pow.py Write a function that computes a to the power of b and returns the value.
12. Fizz Buzz 12-fizzbuzz.py Write a function that prints the numbers from 1 to 100 separated by a space.
13. Insert in sorted linked list 13-insert_number.c, lists.h Write a function in C that inserts a number into a sorted singly linked list.
14. Smile in the mirror 100-print_tebahpla.py Write a program that prints the ASCII alphabet, in reverse order, alternating lowercase and uppercase (z in lowercase and A in uppercase), not followed by a new line.
15. Remove at position 101-remove_char_at.py Write a function that creates a copy of the string, removing the character at the position n (not the Python way, the “C array index”).
16. ByteCode -> Python #2 102-magic_calculation.py Write the Python function def magic_calculation(a, b, c): that does exactly the same as the following Python bytecode: