Author Archives: Eduardo Merino

#Mastery09 Basic types.

there are 3 basic tipes in python:

NUMERIC TYPES:

your basic numbers used for math, algebra, and to calculate various values.

The most basic are intergers and floating point numbers.

intergers, used with the function int( ). are numbers with no desimal poin.
and floating point float( ). support decimal point.

and ther is also:

TEXT SEQUENCE TYPES:

witch is srtings. “Textual data in Python is handled with str objects, or strings. Strings are immutable sequences of Unicode code points. String literals are written in a variety of ways:”(python.org)

and finally:

SEQUENCE TYPES:

witch is lists, tuples, and ranges. witch are agroup of balues, (it could be a mixture of values for lists and touples). In a group or package used as a single object, with many values inside.

#Mastery09 Basic types.

there are 3 basic tipes in python:

NUMERIC TYPES:

your basic numbers used for math, algebra, and to calculate various values.

The most basic are intergers and floating point numbers.

intergers, used with the function int( ). are numbers with no desimal poin.
and floating point float( ). support decimal point.

and ther is also:

TEXT SEQUENCE TYPES:

witch is srtings. “Textual data in Python is handled with str objects, or strings. Strings are immutable sequences of Unicode code points. String literals are written in a variety of ways:”(python.org)

and finally:

SEQUENCE TYPES:

witch is lists, tuples, and ranges. witch are agroup of balues, (it could be a mixture of values for lists and touples). In a group or package used as a single object, with many values inside.

#Mastery22 What type of repetition should I use?

When programing, the use of repetition is very usfull, it makes a program shorter, and more efficient.
But there are many types of repetition in Python, witch one should I use?

Here is a qwick guide with my recomendations.

WHILE:

While loops are used when there is a factor that whill be changin ‘n’ times and you want to stop when said factor changes, also if the user is in control of the loop, if the factor is proned to change you use a while loop. (Learn More about While loops).
examples:

#Mastery22 What type of repetition should I use?x=0
while (x==0):
     print(“Hi”)
     x=int(input(“stop?, 0=no 1=yes”)

Another example.

FOR:

#Mastery22 What type of repetition should I use?For loops are used when you want your process to loop for the amount of time inside a range, When the amount of times it will loop is already pre-determined, either by the user or the programmer, you use a For loop.(Learn more about For loops).

1 example.

RECURSION:
Recursion is used when a function will repeat inside itself, func-ception, it will till a certian answer is reached, this one is tricky because you need to build the fuction with recursion in mind.
My most recent WSQs have been using recursion, so why dont you check that out?.

#Mastery22 What type of repetition should I use?


#Mastery22 What type of repetition should I use?

When programing, the use of repetition is very usfull, it makes a program shorter, and more efficient.
But there are many types of repetition in Python, witch one should I use?

Here is a qwick guide with my recomendations.

WHILE:

While loops are used when there is a factor that whill be changin ‘n’ times and you want to stop when said factor changes, also if the user is in control of the loop, if the factor is proned to change you use a while loop. (Learn More about While loops).
examples:

#Mastery22 What type of repetition should I use?x=0
while (x==0):
     print(“Hi”)
     x=int(input(“stop?, 0=no 1=yes”)

Another example.

FOR:

#Mastery22 What type of repetition should I use?For loops are used when you want your process to loop for the amount of time inside a range, When the amount of times it will loop is already pre-determined, either by the user or the programmer, you use a For loop.(Learn more about For loops).

1 example.

RECURSION:
Recursion is used when a function will repeat inside itself, func-ception, it will till a certian answer is reached, this one is tricky because you need to build the fuction with recursion in mind.
My most recent WSQs have been using recursion, so why dont you check that out?.

#Mastery22 What type of repetition should I use?


#Mastery22 What type of repetition should I use?

When programing, the use of repetition is very usfull, it makes a program shorter, and more efficient.
But there are many types of repetition in Python, witch one should I use?

Here is a qwick guide with my recomendations.

WHILE:

While loops are used when there is a factor that whill be changin ‘n’ times and you want to stop when said factor changes, also if the user is in control of the loop, if the factor is proned to change you use a while loop. (Learn More about While loops).
examples:

#Mastery22 What type of repetition should I use?x=0
while (x==0):
     print(“Hi”)
     x=int(input(“stop?, 0=no 1=yes”)

Another example.

FOR:

#Mastery22 What type of repetition should I use?For loops are used when you want your process to loop for the amount of time inside a range, When the amount of times it will loop is already pre-determined, either by the user or the programmer, you use a For loop.(Learn more about For loops).

1 example.

RECURSION:
Recursion is used when a function will repeat inside itself, func-ception, it will till a certian answer is reached, this one is tricky because you need to build the fuction with recursion in mind.
My most recent WSQs have been using recursion, so why dont you check that out?.

#Mastery22 What type of repetition should I use?


#Mastery26 Strings

Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes ('...') or double quotes ("...") with the same result.(Click here to learn more).

You can turn any value into a string with the str( ) function (like seen in this program). you can also use string inputs. 
str(input()). 

When you make a sum of strings it will make a concatenation:

1+1=

2
“1”+“1”=        Concatenation.
“11”
“Hi “+” I´m “+” George”=    Concatenation
“Hi I´m George”.

#Mastery26 StringsString can also be multiplied as seen in this program.

#Mastery26 Strings

Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes ('...') or double quotes ("...") with the same result.(Click here to learn more).

You can turn any value into a string with the str( ) function (like seen in this program). you can also use string inputs. 
str(input()). 

When you make a sum of strings it will make a concatenation:

1+1=

2
“1”+“1”=        Concatenation.
“11”
“Hi “+” I´m “+” George”=    Concatenation
“Hi I´m George”.

#Mastery26 StringsString can also be multiplied as seen in this program.

#Mastery26 Strings

Besides numbers, Python can also manipulate strings, which can be expressed in several ways. They can be enclosed in single quotes ('...') or double quotes ("...") with the same result.(Click here to learn more).

You can turn any value into a string with the str( ) function (like seen in this program). you can also use string inputs. 
str(input()). 

When you make a sum of strings it will make a concatenation:

1+1=

2
“1”+“1”=        Concatenation.
“11”
“Hi “+” I´m “+” George”=    Concatenation
“Hi I´m George”.

#Mastery26 StringsString can also be multiplied as seen in this program.

#Mastery24 Tuples

A tuple is the same thing that a list in python. Click here to learn about lists.
But thiferent from lists a tuple uses the “( )” signs to enclose the group rather than the “[ ]” of the lists.

The main difference it has is that Tuples CAN’T BE MODIFIED, so al the append, erase and replace functions that work with lists Wont work with a touple. Click here to learn more about Touples.

#Mastery24 Tuples

#Mastery24 Tuples

A tuple is the same thing that a list in python. Click here to learn about lists.
But thiferent from lists a tuple uses the “( )” signs to enclose the group rather than the “[ ]” of the lists.

The main difference it has is that Tuples CAN’T BE MODIFIED, so al the append, erase and replace functions that work with lists Wont work with a touple. Click here to learn more about Touples.

#Mastery24 Tuples