Skip to content

AdamJeddy/Python-Fundamentals

Repository files navigation

Python-Fundamentals

I made this repo so that I can brush up on my Python basics and hopefully improve at it.

I plan on trying out and working on projects with Python in the future

Table of content

1. Hello

  • How to print
  • Get input from user

2. Python-if

  • Exercise 1
    • if, elif and else
    • Overlapping Boolean expressions
    • Nested if code blocks
  • Excercise 2
    • Print data types
    • Converting Str to Boolean values
    • Converting Int to Boolean values
    • Print boolean results
    • Logical Operators
  • Challenge

3. Python-format-strings

  • Exercise 1

    • Compare strings
    • Use of quotes in strings
    • Use of escape sequence
    • Raw strings
    • Multi line String
    • Format strings with print()
  • Exercise 2

    • 3 ways of using capitalize()
    • Modify the case of the string
    • Counts the no. of times 1 str is found in another
    • Inspect the contents of the str
    • Position of a str inside another str
    • Code that strips empty char's from left, right or both
    • Replace 1 str with another
    • Justify a str
  • Exercise 3

    • Format() function's merge feature
    • Formatted string literals, or "f-strings"
    • Format specifiers to control alignment and padding
  • Challenge

4. Python-numeric-operations

  • Exercise 1

    • type() function
    • isinstance() function
    • type() used like isinstance()
    • Variable can point to anything
  • Exercise 2

    • isnumeric()
    • Get user input by using if & isnumeric()
  • Exercise 3

    • Mathematical operations
    • Control the default order of operations
    • Investigate division more closely
    • Code to convert a float into an int
    • Code that rounds to a specific decimal place
  • Challenge 1

  • Challenge 2 - Calculator

5. Python-standard-library

  • Exercise 1
    • Class Random
  • Exercise 2
    • Add code to import & call the new package's functionality

6. Python-while

  • Exercise 1

    • Using optional statements break and else
    • Handle empty input
  • Exercise 2

    • Increment while loop
    • Decrement while loop
  • Challenge 1

    • Write the code to implement a number guessing game
  • Challenge 2

    • Write the code to implement an improved num guessing game

7. Python-lists

  • Exercise 1

    • Create a list of values
    • Empty list
    • Use an index to access individual elements
    • Create a slice
    • Reverse and sort list
    • Treat the list like a queue a list
    • Combine a new list with an existing list
    • Clear all items from a list
  • Exercise 2

    • Test a value for inclusion in a list
    • Loop through the List
    • Break out a for loop
    • Use an else statement
    • Use a continue statement
    • Create nested for loops
    • Choose randomly from a list
  • Challenge

    • Deal a deck of cards to players

8. Python-functions

  • Exercise 1

    • Add code to the code file to create and call a small function
    • Update the code from the previous step and add code to accept an input parameter
    • Modify the function call to leave out the argument
    • Update the code example to include a 2nd optional input parameter
      • Add a new function that returns a value
      • Add a new function that returns a list
      • Add a new function that demonstrates variable scope in a function
  • Exercise 2

    • Using *args and **kwargs
  • Exercise 3

    • Importing the file deck.py
      • Using its function to create a set of cards and printing them
  • Challenge

About

Complete Python fundamentals

Topics

Resources

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy