#TC101 Review

--Originally published at TC101 – Peaz Cooper

TC101 Topics of my WordPress

  • Use of comments
  • Python conventions (Zen of Python but others for other languages)
  • Basic types and their use
  • Basic output (print)
  • Basic user input (text based)
  • Calling functions
  • Creating functions
  • Importing and using modules/libraries
  • Creating and using your own modules/libraries
  • Use of the conditional “if”
  • Use of “else” with a conditional (and elif for Python)
  • Use of loops with “while”
  • Use of loops with “for”
  • Creation and use of Lists/Tuples (Python)
  • Creation and use of strings
  • Reading and writing of text files
  • Creation and use of ranges in Python
  • Creation and use of dictionaries in Python

I’m kinda lazy to write all over again cause it took a long time to write every single post with every single detail and  mistake you could possibly make… so don’t be creepy and check out all of my posts or check these links:

 

And this list of videos for python!


If you follow any of these links you’ll magically learn every single stuff about python in no time! (1 semester)


Create a “GitHub” account

--Originally published at TC101 – Peaz Cooper

Okay… Let’s start… this is very simple so there’s no need for a video tutorial.


GitHub is a web-based Git repository hosting service. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project.


1.- Go to the GitHub sign up page. This page is used to sign you up for a free GitHub plan.

2.- Enter a username, valid email address, and password.

3.- Review the GitHub Terms of Service and Privacy Policy before continuing.

4.- Click the “Create an account” button to complete the process.

 


Create a “WordPress” account

--Originally published at TC101 – Peaz Cooper

Okay… Let’s start… this is very simple so there’s no need for a video tutorial.


WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. WordPress is installed on a web server, which either is part of an Internet hosting service or is a network host itself; the first case may be on a service like WordPress.com, for example, and the second case is a computer running the software package WordPress.org. An example of the second case is a local computer configured to act as its own web server hosting WordPress for single-user testing or learning purposes. (Wikipedia)


1.- Go to wordpress.com

2.- Sign up in register

3.- Create an account with your personal data

4.- Send me some food

5.- Rearrange the information

6.- Diversify your topics

7.- Create a lot of blog posts

8.- Throw shade at other student’s blog posts


Create a “Twitter” account

--Originally published at TC101 – Peaz Cooper

Okay… Let’s start… this is very simple so there’s no need for a video tutorial.


What’s Twitter?

Twitter is an online news and social networking service where users post and read short 140-character messages called “tweets” (Wikipedia). This social network has improved the communication among the millennial age.


1.- Go to twitter.com

2.- Go to register

3.- Enter your personal info (don’t worry… the FBI has it anyway)

4.- Submit your request for an account

5.- Verify your account with your mail account

6.- Adjust your settings

7.- Follow @NotCooperfield (it is indeed necessary)

8.- Enjoy throwing shade to mortals

 


Partial II – Ranges in Python (and more lists)

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

Do you know what’s a Python dictionary? Is it in English? Are tacos tacos if they don’t have any meat? Together we will learn the answers to these awesome and mind-blowing questions!


As in math, the range is the quantity of variables between to limits or specific points, while it generates a list of numbers it is used mostly for loops, and this one is  if we want to perform an action n number of times! (as far as I know). Well… as you may already know this is not my top topic… but here’s a useful video!


If you follow these steps you’ll be coding like a bawse in no time!!!

#PeazCooperOut #TC101


Part II – Creation and use of dictionary

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

Do you know what’s a Python dictionary? Is it in English? Are tacos tacos if they don’t have any meat? Together we will learn the answers to these awesome and mind-blowing questions!


A dictiorany is mostly a way to store the data like a list (see my previous posts). The thing here is that instead of using just numbers to get the data you can also use almost anything.  We can use numbers to index into a list, meaning that the lists can be used with numbers- But let’s remember from our previous experiences that we can only use numbers to get items out of a lsit.

This video is very helpful! Check it out!!! IT has been approved by KhanAcademy and Richard Carrera (Tec and Dell’s specialist).


If you follow these steps you’ll be coding like a bawse in no time!!!

#PeazCooperOut #TC101


Part II – There are no STRINGS on me!

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

How can I create a string? For what? Do I need a lamb first? Together we will learn the answers to these awesome and mind-blowing questions!


Strings are amongst the most popular types in Python. We can create them simply by enclosing characters in quotes. Python treats single quotes the same as double quotes. Creating strings is as simple as assigning a value to a variable.

var1 = 'Hello World!'
var2 = "Python Programming"

Python does not support a character type; these are treated as strings of length one, thus also considered a substring.

To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring.

var1 = 'Hello World!'
var2 = "Python Programming"

print "var1[0]: ", var1[0]
print "var2[1:5]: ", var2[1:5]

You can “update” an existing string by (re)assigning a variable to another string. The new value can be related to its previous value or to a completely different string altogether.


If you follow these steps you’ll be coding like a bawse in no time!!!

#PeazCooperOut #TC101


Part II – Creation and use of Lists/Tuples

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

Is it real that only god can create such a variety of organisms? Can we do the same with a use of lists? Have you seen Walter White? Together we will learn the answers to these awesome and mind-blowing questions!


Okay this is kinda cheating… but here’s a brief explanation from sthurlow that explains perfectly!

  • Lists are what they seem – a list of values. Each one of them is numbered, starting from zero – the first one is numbered zero, the second 1, the third 2, etc. You can remove values from the list, and add new values to the end. Example: Your many cats’ names.
  • Tuples are just like lists, but you can’t change their values. The values that you give it first up, are the values that you are stuck with for the rest of the program. Again, each value is numbered starting from zero, for easy reference. Example: the names of the months of the year.
  • Dictionaries are similar to what their name suggests – a dictionary. In a dictionary, you have an ‘index’ of words, and for each of them a definition. In python, the word is called a ‘key’, and the definition a ‘value’. The values in a dictionary aren’t numbered – tare similar to what their name suggests – a dictionary. In a dictionary, you have an ‘index’ of words, and for each of them a definition. In python, the word is called a ‘key’, and the definition a ‘value’. The values in a dictionary aren’t numbered – they aren’t in any specific order, either – the key does the same thing. You can add, remove, and modify the values in dictionaries. Example: telephone book.

So check out this page for information

Continue reading "Part II – Creation and use of Lists/Tuples"

Part II – Creation and use of strings

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

What is a string? How can you create it? Am I Pinnochio? Together we will learn the answers to these awesome and mind-blowing questions!


We can create them simply by enclosing characters in quotes. Python treats single quotes the same as double quotes. Creating strings is as simple as assigning a value to a variable.

var1 = 'Hello World!'
var2 = "Python Programming"

Python does not support a character type; these are treated as strings of length one, thus also considered a substring.

To access substrings, use the square brackets for slicing along with the index or indices to obtain your substring.

#!/usr/bin/python

var1 = 'Hello World!'
var2 = "Python Programming"

print "var1[0]: ", var1[0]
print "var2[1:5]: ", var2[1:5]

(WIKI)

If you follow these steps you’ll be coding like a bawse in no time!!!

#PeazCooperOut #TC101


Part II – Recursive Functions

--Originally published at TC101 – Peaz Cooper

Well well well! First of all! Ask yourself the following questions:

Do you know what recursive functions? I like squirtle! Together we will learn the answers to these awesome and mind-blowing questions!


Recursion is a way of programming or coding a problem, in which a function calls itself one or more times in its body. Usually, it is returning the return value of this function call. If a function definition fulfills the condition of recursion, we call this function a recursive function.

The adjective “recursive” originates from the Latin verb “recurrere”, which means “to run back”. And this is what a recursive definition or a recursive function does: It is “running back” or returning to itself. Most people who have done some mathematics, computer science or read a book about programming will have encountered the factorial, which is defined in mathematical terms as

n! = n * (n-1)!, if n > 1 and f(1) = 1

Example:
4! = 4 * 3!
3! = 3 * 2!
2! = 2 * 1

Replacing the calculated values gives us the following expression
4! = 4 * 3 * 2 * 1

Generally, we can say: Recursion in computer science is a method where the solution to a problem is based on solving smaller instances of the same problem.The possible combinations quickly multiply out to unimaginably large numbers. Indeed, the repertoire of sentences is theoretically infinite, because the rules of language use a trick called recursion. A recursive rule allows a phrase to contain an example of itself, as in She thinks that he thinks that they think that he knows and so on, ad infinitum. And if the number of sentences is infinite, the number of possible thoughts and intentions is infinite too, because virtually every sentence expresses a

Continue reading "Part II – Recursive Functions"