Skip to content

Commit

Permalink
Github/IrisDroidology/Python-Learning files #1
Browse files Browse the repository at this point in the history
Python and games for Starter Stellarios
  • Loading branch information
Gizmotronn authored Oct 5, 2019
1 parent 558923e commit 8c916e5
Show file tree
Hide file tree
Showing 44 changed files with 737 additions and 0 deletions.
61 changes: 61 additions & 0 deletions stellarios/Python-Games/Udemy/Networking/CSC P.Mod/Topologies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
• Bus
• Ring
• Star
• Mesh
• Hybrid

What is a topology?
• The ways nodes in networks are connected together

Bus Topology
• Early ethernet networks used a bus structure
• Modern ethernet networks use a star bus structure (hybrid)
• Every device and computer is connected to a single cable
• Linear bus topology - 2 end points
• Features:
○ Every device is connected to one cable
○ Transmits data in one direction
• Advantages:
○ Cost effective
○ Low amount of cable required (compared to other networking topologies)
○ Used in small networks
○ Easy to understand and set-up
○ Easy to expand (join 2 cables together)
• Disadvantages:
○ If cable fails, network fails
○ If network is heavy performance decreases
○ Limited cable length
○ Slower than ring topology
Ring Topology
• Each computer is connected to another computer
○ (Benzene shape)
○ 2 neighbours for each device
• Features:
○ A number of repeaters are needed (as data has to travel through all the nodes from the first computer/device to the desired node)
○ Unidirectional transmission
§ However, bidirectional transmission can be done by having 2 connections between each device
§ Benzene double bonding (eg)
§ Dual Ring Topology
○ Dual Ring Topology - 2 ring networks are formed
§ 1 can be a backup
○ Data is transferred bit by bit in a sequential manner
• Advantages:
○ Cheap to install and expand
○ Network is not affected by high traffic or adding more nodes
• Disadvantages:
○ Troubleshooting is difficult
○ Adding/deleting nodes disturbs the network activity
○ Failure of one computer disturbs the whole network
Mesh Topology
• Both Wi-Fi & Bluetooth are being upgraded to support Mesh Networking


Star Topology

Hybrid Topology
• Modern Ethernet Networks use a hybrid topology structure (star bus)


References
• http://www.steves-internet-guide.com/networking/
• https://www.studytonight.com/computer-networks/network-topology-types.php
18 changes: 18 additions & 0 deletions stellarios/Python-Games/Udemy/Networking/Cisco/Untitled-1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Introduction to networking
# Lecture link: https://www.udemy.com/course/cisco-ccna-network-fundementals-chapter-1/learn/lecture/2130534#overview

Lecture Link: https://www.udemy.com/course/cisco-ccna-network-fundementals-chapter-1/learn/lecture/2130534#overview

What is a network?
• Having 2 or more devices communicating in some way
○ These devices can be considered as nodes
○ Communicate with each other
• Node - anything that has the ability to communicate
• Wired/wireless
• IP - a protocol to communicate
○ Nodes are devices that communicate with each other using IP
• Network card - used for communications
○ NIC - network interface card
○ For wired networks, a network cable is plugged in to the connected devices' NIC
○ Purpose: move data over wires, to another network card

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
https://www.udemy.com/course/networking-concepts-for-beginners/learn/lecture/6060530#overview

LANs
• A Local Area Network is a group of computers and associated devices that share a common communications line or wireless link to a server
• A LAN includes devices and computers that are connected to a server within a small geographical landscape, for example an office building or a house
• Computers, and other devices can share resources
○ Printer
○ Network storage
• A LAN can serve one or 2 users, or hundreds
○ The definition does not depend on the size of the group, rather the geographical size

WANs
• Wide Area Network
• Geographically dispersed telecommunications network
• May be privately owned or rented
○ However, the term WAN usually denotes shared networks (public)
• Computers and users can communicate with computers and users in other locations
• Hundreds of branches in different cities are connected with each other

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# First Application - Calculator
# Lecture: https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/13282934#overview (#14)

# Defining two numbers for operations
print("Enter first number: ")
firstNumber = int(input())
print("Enter second number: ")
secondNumber = int(input()) # we can also use floats

# Operations
"""
print(firstNumber + secondNumber)
This will not work (line 12) as both input variables are a string type
"""
"""
For example, if I set the value of "firstNumber" to 1, and "secondNumber" to 2,
adding them together will produce 12
"""
"""
We need to turn the strings into integers:
print("Enter first number: ")
firstNumber = int(input())
print("Enter second number: ")
secondNumber = int(input())
"""

print(firstNumber " + " secondNumber " = " firstNumber + secondNumber) # addition
print(firstNumber * secondNumber) # multiplication
print(firstNumber / secondNumber) # division
print(firstNumber - secondNumber) # subtraction
print(firstNumber % secondNumber) # modulus
16 changes: 16 additions & 0 deletions stellarios/Python-Games/Udemy/Python Masterclass/Casting.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Casting - Changing Data Type
# Lecture: https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/13282888#overview

number = "5" # string variable - variable "number" is string
number2 = 10 # integer variable
# number3 = number + number2 # Creates an error
number3 = int(number) + number2 # converts the data/variable type of number and adds it to number2

# Integer to float:
floattobe = 5
float1 = float(floattobe)

# Integer to string:
stringtobe = 10
firststring = "ggg"
string1 = str(stringtobe) + firststring
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Closer Look at Numbers
# Lecture: https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/13270006#overview

# Integers
integer = 5

# Floating point
floatnumber = 5.0
float = 5.1
negfloat = -5

# Complex Numbers
complexnumber = 5 + 5j

# Printing Numbers
print(type(float)) # determines what type of number the variable "float" is, in this case it would output "float" - "Class Float"
print(integer) # prints the value of the number-integer variable "integer" to the console - prints "5" to console

# Number Operations
number1 = 1
number2 = 2
number1n2 = number2 + number1 # sets the value of the variable "number1n2" to the value of "number1" & "nummber2" added - 1 + 2 = 3

number1 = 1.0
number2 = 2
number1x2 = number1 * number2 # this is now a float, as at least one of the variables (number1) is a floating point number variable
print(number1x2) # prints 2.0
16 changes: 16 additions & 0 deletions stellarios/Python-Games/Udemy/Python Masterclass/getting-input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Getting input
# Lecture: https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/13270018?start=0#overview

# Starting off with input and variables:
msg = "What is your name? "
print(msg)
userName = input() # sets the input to the input variable from msg (line5)
print("Hello, " + userName)

# This all works so far.....

print(type(userName)) # <class 'str'>
"""
# Regardless of the user input, the input is always a string
# String concatenation still works, however
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""
https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/12851018#overview
Q & A -- Introducing yourself
https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/12851022#questions
Hi there! My name is Liam Arbuckle, I'm from Australia, and I'm enrolled in this course to learn more about Python. I have a little bit of experience in Python - including lists, tuples, and a little bit of pygame, however I don't have much experience in putting those tools to real world use. This course looks like a way to fix that!
"""

# First Program - Hello World
msg = "Hello World!"
print(msg) # even though the variable "msg" is a string, since we are inputting variable there is no need for quotes
# prints the value of string variable "msg" to the console

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Starting Of Operations
# Lecture: https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/13270000#overview

# Integer Operations

number = 50
number2 = 20
number3 = 10 + 20
number4 = number + number2
number5 = number + 10
numberMultiply = number * number5

# String Operations
stringvariable = "aaa"
stringvariable2 = "bbb"
stringvariable3 = stringvariable + stringvariable2 # Concatenation of strings, outputs "aaabbb" to the console

stringvariable4 = "..."

"""
Right now, we cannot add an integer variable and a string together - need to convert int to string variable
However, we can multiply a string by an integer variable or a number (see lines 10, 7 of this file to see what I mean)
"""

a = "a"
number = 5
repeata = a * number # Sets the value of STRING variable "repeata" to "aaaaa", or the value of variable "a" repeated the number of times that is seen in the integer variable "number"
print(repeata) # Prints "aaaaa" to the console as an output
31 changes: 31 additions & 0 deletions stellarios/Python-Games/Udemy/Python Masterclass/strings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Strings
# Lecture: https://www.udemy.com/course/python-masterclass-for-beginners/learn/lecture/13270012#overview

stringVariable = "hello" # Sets the value of the string variable "stringVariable" to "hello" (array of characters)

# Indexing
print(stringVariable) # prints/accesses whole string
print(stringVariable[0]) # Index value - prints "h" (h = 0, e = 1, o = 4). Accessing 1 character at a time

print(stringVariable[1:3]) # Index value - 1,2,3 (e,l,l) - prints "ell"
# Length
print(len(stringVariable)) # prints 5 - 5 characters

# Removing whitespace
whitespace = " white spa ce"
print(whitespace.strip) # Spaces in between characters are still there, spaces in front and at end are deleted

# Lowercase & uppercase
lower = "this is lower"
print(lower.capitalize()) # first character is capatalized
# Caps lock
print(lower.upper())
upper = "this is upper"
print(upper.lower())

# Replacing characters
string1 = "shshshshshsh"
print(string1.replace('h', 'a')) # old, new, count
# Split
string1 = "sh sh sh"
string2 = string1.split(' ') # splits white space/spaces
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Stuff to remember
"""
Basically stuff that I haven't quite gotten downpat/memorized
"""

# Casting
# Integer to string
myInt = 1
myStringInt = str(myInt) # changes from integer to string

# Integer to float
myInt = 1
myFloatInt = float(int) # 1 --> 1.0

# String to int
myString = 1
myIntString = int(myString)

# Concatenation can be done with casting

# Other Stuff
float = 1.0
print(type(float)) # determines what type of number the variable "float" is, in this case it would output "float" - "Class Float"
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Data Types in Python

Classified into 5 categories

* Numbers
* Strings
* Lists
* Tuples
* Dictionaries

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Data Types in Python

#Classified into 5 categories

#- Numbers
#- Strings
#- Lists
#- Tuples
#- Dictionaries

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Assign an integer value 25 to the variable age
age = 25
print(age)

# Output => 25
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Easy - Declare a variable without breaking any of the rules
variable = 70 # integer variable

# Medium - Declare this variable “break = 50”. Which rule does it break ?
# It uses the Python keyword "break"

# Hard - Make changes to these variables so that they no longer break the rules to
define a variable

phoneNumber = 12345 # integer variable, original name was phone$phoneNumber
Name = "Benny" # Original name for variable was 123 name
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
I installed version 3.7.4 of Python from http://python.org

[![forthebadge made-with-python](http://ForTheBadge.com/images/badges/made-with-python.svg)](https://www.python.org/)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Numbers

* Arithmetic values used for mathematical purposes

2 types of number variables (currently learnt):

```python
myinteger = 20
myfloatingpointnumber = 20.1
```



Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
myinteger = 20
myfloatingpointnumber = 20.1
Loading

0 comments on commit 8c916e5

Please sign in to comment.