# data[].attributes.headline
The Elements of Computing - A focus on Python 

# data[].attributes.subject
The Elements of Computing - A focus on Python 

# data[].attributes.body
"The purpose of computing is insight, not numbers" - Richard Hamming

# data[].attributes.body
Before moving on to explore Python, we must understand Data Types because variables can hold different types of data, and understanding these types helps us perform various operations and make the programs we create more robust and flexible.

Data Types define the type of value a variable can hold, specifying the operations that can be performed on it and the methods of storage and representation.

# data[].attributes.body
The next step in our journey learning Python is understanding what Operators are. Learning how to use operators allows us to perform computations, make decisions, and control the flow of our program.

Operators are symbols or keywords that perform operations on one or more operands, such as arithmetic, comparison, and logical (see above to explore) facilitating various computations and manipulations within the code.

# data[].attributes.body
Now that we are familiar with basic operations and expressions using operators, understanding and working with secondary data structures becomes essential for managing more complex and structured data in our programs. They provide powerful tools for organizing and manipulating data, making them a logical next step in our explorations of Python

# data[].attributes.body
After we grasp data structures, learning how to control the flow of our program using conditions and loops becomes crucial for writing more complex and dynamic code. Control structures in Python, including conditional statements (if, if-else, if-elif-else), looping statements (for, while), and control statements (break, continue, pass), enable us to manage the flow of execution in their code based on conditions and iterations.

# data[].attributes.body
I used W3 Schools for some of the simple definitions that I couldn't find in my notes.

https://www.w3schools.com/

All other data and code was taken from my labs or from the labs made by Professor Katherine Walden which can be found at

https://canvas.nd.edu/courses/73794

Images were taken from the google images tab

# data[].attributes.body
Once we can control the flow of our program with constructs like loops and conditional statements, handling input from users, reading data from files, and presenting output become crucial aspects of writing programs. I/O (input/output) refers to the process of interacting with external data sources, devices, or the user by reading from or writing to files, receiving input from the keyboard or other sources, and displaying output to the screen or other destinations.

# data[].attributes.headline
Head to the MIDDLE of the Padlet(the large white sticky) to begin your journey...

# data[].attributes.subject
Head to the MIDDLE of the Padlet(the large white sticky) to begin your journey...

# data[].attributes.body
Begin at the white sticky titled "The Elements of Computing" and follow the story of discovering Python. I suggest zooming out to grasp the full landscape before beginning. Start in the middle and then move to "1. Data Types" and so on. I numbered the sections for ease of navigation and they build off of each other. Each of these sections contains at least some bit of example code so hopefully you can replicate each concept yourself.

# data[].attributes.body
Thank you for following me on this journey through this exploration of Python! I hope you are nowable to do some coding yourself.

# data[].attributes.body
A string is a sequence of characters, enclosed in single or double quotation marks, that represents textual data and can be manipulated using various built-in methods.

Example Code:

mystring = "Hello, World!"

# data[].attributes.body
An integer in python is relatively self-explanatory. It is a data type used to represent whole numbers without any fractional part, allowing for arithmetic operations and manipulation of numerical values.

# data[].attributes.body
A float is a data type used to represent numbers with decimal points or in exponential notation, enabling the representation of both whole and fractional values, allowing for more precise numerical calculations.

# data[].attributes.body
A Boolean is a data type that can have one of two values, either True or False, and is primarily used for logical operations and conditional expressions.

# data[].attributes.body
Arithmetic operators are symbols like "+", "-", "/", "%", "*" used to perform basic mathematical operations, including addition, subtraction, division, etc.

Example Code (Addition):

num1 = 10

num2 = 5

add = num1 + num2

print("Sum:", add)

The output would appear like:

"Sum: 15"

# data[].attributes.body
Logical operators (such as "and", "or", "not") are used to combine or manipulate boolean values, helping to create conditions for decision-making in code.

Example Code (And):

num1 = 10

num2 = 5

condition = (num1 > 0) and (num2 < 10)

print(condition)

The output would appear like:

"True"

# data[].attributes.body
Comparison operators, such as ">", "<", ">=", "<=", "==", and "!=", are used to compare values and create conditions for decision-making in code.

Example Code (Greater Than):

num1 = 10

num2 = 5

condition = num1 > num2

print("Greater Than:", condition)

The output would appear:

"Greater than: True"

# data[].attributes.body
Lists are another self-explanatory aspect of Python. They are a data structure that can hold an ordered collection of elements, allowing for flexible storage, retrieval, and modification of data.

Example Code:

colors = ["red", "blue", "green"]

secondcolor = colors[1]

print("Second color:", second color)

print("List of colors:", colors)

Output:

"Second color: blue"

"List of colors: red blue green"

# data[].attributes.body
A dictionary is an unordered data structure that stores key-value pairs, enabling efficient storage, retrieval, and manipulation of data based on unique keys. They are similar to lists but while both lists and dictionaries in Python are used to store and organize data, lists are ordered and accessed by position, whereas dictionaries use keys for access and are unordered.

# data[].attributes.body
A tuple is a fixed and ordered collection of elements, similar to a list, but unlike lists, tuples are immutable, meaning their values cannot be changed after creation.

# data[].attributes.body
A set is an unordered and mutable collection of unique elements, allowing for efficient membership testing, intersection, and union operations. Sets differ from lists, dictionaries, and tuples by being unordered, mutable collections of unique elements that do not allow duplicates.

# data[].attributes.body
Iterations refer to the process of repeatedly executing a block of code, either for each element in a sequence (as in a "for" loop) or as long as a specified condition is true (as in a "while" loop).

Example Code:

numbers = [1, 2, 3, 4, 5]

for num in numbers:

print(num)

Output:

1

2

3

4

5

Analysis: This is a super simple example of a "for" loop in Python that iterates over a list of numbers and prints each number

# data[].attributes.body
A loop is something we have explored a bit already. It is a construct that allows for the repetitive execution of a block of code, iterating over a sequence of elements (as in a "for" loop) or executing as long as a specified condition is true (as in a "while" loop).

# data[].attributes.body
A function is a reusable and modular block of code designed to perform a specific task, often accepting input parameters and returning a result. See some examples here.

# data[].attributes.body
A built-in function in Python is a pre-defined and readily available function provided by the Python interpreter to perform common operations, such as manipulating data, interacting with the environment, or performing mathematical calculations.

An example of a built-in function in Python is the len() function, which returns the number of items in a given iterable (e.g., string, list, or tuple)

# data[].attributes.body
Creating functions involves defining a reusable block of code with a specific name, a set of parameters that can be passed when calling the function, and an optional return statement to provide a result back to the caller.

# data[].attributes.body
Input in Python refers to the process of receiving data into a program using functions like input() to capture information during program execution.

# data[].attributes.body
Output in Python involves presenting or displaying data from a program using functions like print() to showcase results, messages, or calculated values.

We have seen this multiple times in out example codes.

# data[].attributes.body
The open() function in Python is used to create a file object, establishing a connection between the program and an external file.

# data[].attributes.body
The read() method in Python is applied to a file object and is used to retrieve the content of the file, returning it as a string or in chunks, depending on the specified or default number of bytes to read.

Example Code:

file = 'example.txt'

with open(file, 'r') as file:

content = file.read()

print(content)

Output:

Let's say the file said "Happy Birthday"

It would print "Happy Birthday" as this in the content withing the file. This is what it read

# data[].attributes.body
The write() method in Python is applied to a file object opened in write mode, allowing the program to add or overwrite content in the file, with the provided data being written to the file.

# data[].attributes.body
Structured data in Python refers to the the organized collections of data, often represented using data structures like the ones we have discussed (lists, tuples, dictionaries,etc.), enabling efficient storage, retrieval, and manipulation of information in a program.

# data[].attributes.body
JSON is a data interchange format that represents data in a text format using key-value pairs and arrays, providing a basic and widely used data structure for communication between web servers for files.

# data[].attributes.body
Pandas is a open-source data manipulation library that provides data structures like DataFrames and Series, along with a wide range of functions, to efficiently handle and analyze structured data.

# data[].attributes.body
These include lists or dictionaries, where each row in the CSV may be represented as a list or dictionary, enabling organized storage and manipulation of the information.

# data[].attributes.body
This refers to information structured in rows and columns, often stored in a comma-separated values (CSV) file, and can be efficiently manipulated using libraries like csv for reading, writing, and processing data.

# data[].attributes.body
Loading data from a CSV file in Python involves using the csv module or pandas to read the file, converting its delimited/tabular contents into appropriate data structures (such as lists or dataframes) for further analysis or manipulation.

Example Code:

import csv

csvfile = 'example.csv'

with open(csvfile, 'r') as file:

csv_reader = csv.reader(file)

for row in csv_reader:

print(row)

Output:

If our CSV file looked like

Name: Patrick, Age: 19, City: South Bend

we would see ['Patrick', '19', 'South Bend']

# data[].attributes.body
Example Code:

{

"name": "Patrick",

"age": 19,

"city": "South Bend",

"isStudent": true,

"grades": [90, 92, 91],

}

With JSON, it is a data structure, so it doesn't have an output in the way the other code we have explored does.

# data[].attributes.body
This is like the opposite of loading data. Writing data to a CSV file involves using pandas to format and write data, typically organized in lists or dictionaries, into the file for storage or future use.

# data[].attributes.body
Loading data from a file using pandas involves using the pandas library to read and convert data from various file formats (such as CSV, Excel,etc that we have talked about) into a DataFrame.

# data[].attributes.body
Exploring a basic DataFrame in pandas includes inspecting the first rows, checking data types, and obtaining summary statistics using functions like head(), info(), and describe().

# data[].attributes.body
This involves operations such as selecting specific columns, filtering rows based on conditions, and adding or removing columns. See below for some examples.

This can be used in assisting with the Web Scraping process to sort the data.

# data[].attributes.body
Selecting in pandas involves retrieving specific rows or columns from a DataFrame.

# data[].attributes.body
Sorting is like what the name says. It involves arranging the rows of a DataFrame based on the values in one or more columns, either in ascending or descending order, using the sort_values() function.

# data[].attributes.body
This involves extracting specific rows or columns from a DataFrame based on specified conditions, allowing for targeted exploration and analysis of the data.