Skip to content

Commit 4538847

Browse files
committed
Added starter files
0 parents  commit 4538847

14 files changed

+75
-0
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__pycache__
2+
.vscode
3+
.DS_Store

python_sandbox_starter/classes.py

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# A class is like a blueprint for creating objects. An object has properties and methods(functions) associated with it. Almost everything in Python is an object
2+
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# If/ Else conditions are used to decide to do something based on something being true or false
2+
3+
4+
5+
# Comparison Operators (==, !=, >, <, >=, <=) - Used to compare values
6+
7+
8+
9+
# Logical operators (and, or, not) - Used to combine conditional statements
10+
11+
12+
13+
14+
# Membership Operators (not, not in) - Membership operators are used to test if a sequence is presented in an object
15+
16+
17+
18+
19+
# Identity Operators (is, is not) - Compare the objects, not if they are equal, but if they are actually the same object, with the same memory location:
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# A Dictionary is a collection which is unordered, changeable and indexed. No duplicate members.

python_sandbox_starter/files.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Python has functions for creating, reading, updating, and deleting files.

python_sandbox_starter/functions.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# A function is a block of code which only runs when it is called. In Python, we do not use parentheses and curly brackets, we use indentation with tabs or spaces
2+
3+
4+
5+
# A lambda function is a small anonymous function.
6+
# A lambda function can take any number of arguments, but can only have one expression. Very similar to JS arrow functions
7+

python_sandbox_starter/lists.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# A List is a collection which is ordered and changeable. Allows duplicate members.

python_sandbox_starter/loops.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).
2+
3+
4+
5+
# While loops execute a set of statements as long as a condition is true.

python_sandbox_starter/modules.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# A module is basically a file containing a set of functions to include in your application. There are core python modules, modules you can install using the pip package manager (including Django) as well as custom modules

python_sandbox_starter/py_json.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# JSON is commonly used with data APIS. Here how we can parse JSON into a Python dictionary

python_sandbox_starter/strings.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Strings in python are surrounded by either single or double quotation marks. Let's look at string formatting and some string methods
2+
3+
4+
# String Formatting
5+
6+
# String Methods

python_sandbox_starter/tuples_sets.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# A Tuple is a collection which is ordered and unchangeable. Allows duplicate members.
2+
3+
4+
5+
# A Set is a collection which is unordered and unindexed. No duplicate members.

python_sandbox_starter/validator.py

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Example of a custom module to be imported
2+
3+
import re
4+
5+
6+
def validate_email(email):
7+
if len(email) > 7:
8+
return bool(re.match("^.+@(\[?)[a-zA-Z0-9-.]+.([a-zA-Z]{2,3}|[0-9]{1,3})(]?)$", email))

python_sandbox_starter/variables.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# A variable is a container for a value, which can be of various types
2+
3+
'''
4+
This is a
5+
multiline comment
6+
or docstring (used to define a functions purpose)
7+
can be single or double quotes
8+
'''
9+
10+
"""
11+
VARIABLE RULES:
12+
- Variable names are case sensitive (name and NAME are different variables)
13+
- Must start with a letter or an underscore
14+
- Can have numbers but can not start with one
15+
"""

0 commit comments

Comments
 (0)