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
- How to print
- Get input from user
- 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
-
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
-
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
- Exercise 1
- Class Random
- Exercise 2
- Add code to import & call the new package's functionality
-
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
-
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
-
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
- Importing the file deck.py
-
Challenge