FOR ALL THOSE PROCRASTINATORS

--Originally published at Coding The Future

If you are reading this right now, you were probably procrastinating, and just started studying for tomorrow's test, right?

Well, as always, I've got you covered. Here's a quick video summary of what you need to know for the first partial. I hope things are not too strange.

Good luck!

I AIN’T GOT NO TYPE

--Originally published at Coding The Future

Image via GIPHY

Personally, I am not a rap fan, but again, I am making a reference to a song. This time, No Type by Rae Sremmurd came to mind when thinking about the different types of data you can work with on Python.

Even though we've already been working with them, let's discuss these data types in more detail...

  • Integers: They store a whole numeric value with no decimals, e.g.: 5.
  • Floats: They store a numeric value with decimals, e.g.: 23.43.
  • String: They store a string of characters of any type, e.g.: "Hello". Note that in Python there is no char (character) type. If you wanted to store only one character, use a string of length one. Also, just like it's name suggests, it is a string of characters tied together, so you can access each character using it's position. For example, in "Hello", string[1] is 'e'.
  • Booleans: They store a binary value of true or false. Basically, a variable of this type can only have a value of true or false. The false value can be expressed as 0, and true as any other number. E.g.: userIsMale = false.

Also, there are types in which several items can be stored within one variable. In other programming languages, they are usually called arrays, but in python they are somewhat different.

  • Lists: A list that stores several variables, and can be expansible. They are not limited to just storing one type of data; or in other words, you can store ints, strings, floats, in just one list. E.g.: list = [1, 2, hey, music, 12.34]
  • Tuples: Similar to a list, but static. Once it is declared, it remains fixed. E.g.: tuple = {1, 3, hello}

That's Continue reading "I AIN’T GOT NO TYPE"

I AIN’T GOT NO TYPE

--Originally published at Coding The Future

Image via GIPHY

Personally, I am not a rap fan, but again, I am making a reference to a song. This time, No Type by Rae Sremmurd came to mind when thinking about the different types of data you can work with on Python.

Even though we've already been working with them, let's discuss these data types in more detail...

  • Integers: They store a whole numeric value with no decimals, e.g.: 5.
  • Floats: They store a numeric value with decimals, e.g.: 23.43.
  • String: They store a string of characters of any type, e.g.: "Hello". Note that in Python there is no char (character) type. If you wanted to store only one character, use a string of length one. Also, just like it's name suggests, it is a string of characters tied together, so you can access each character using it's position. For example, in "Hello", string[1] is 'e'.
  • Booleans: They store a binary value of true or false. Basically, a variable of this type can only have a value of true or false. The false value can be expressed as 0, and true as any other number. E.g.: userIsMale = false.

Also, there are types in which several items can be stored within one variable. In other programming languages, they are usually called arrays, but in python they are somewhat different.

  • Lists: A list that stores several variables, and can be expansible. They are not limited to just storing one type of data; or in other words, you can store ints, strings, floats, in just one list. E.g.: list = [1, 2, hey, music, 12.34]
  • Tuples: Similar to a list, but static. Once it is declared, it remains fixed. E.g.: tuple = {1, 3, hello}

That's Continue reading "I AIN’T GOT NO TYPE"

I DON’T SPEAK GERMAN (BUT I CAN IF YOU LIKE)

--Originally published at Coding The Future

If you are a Lady Gaga fan, you are probably familiar with her famous line "I don't speak German, but I can if you like" from her song SchieBe. This lyric line has always intrigued me, but it has acquired a new meaning since I started programming. Why? Because once you learn an object-oriented language, all others come naturally in a matter of days.

I started coding on Python 3 for the first time last week, and coming from C# on Visual Studio 2008 felt like a natural transition. All the syntax is pretty much the same, and some is even simpler, which is an amazing thing!

I have taken the time to compile the most basic syntax that I've learned on Python so far. Enjoy!

1. Comments

When we think about coding, commenting often goes as an underestimated feature. Consequently, I decided to start my post with comments.

#COMMENTS: To comment, use a number sign and then write your comment.

2. Declaring variables (and arrays)

Unlike other programming languages, I've realized that on Python, you don't have to declare the variable type when declaring a variable. To declare a variable, just type the name, and if you want to, give it a value. Even though you don't need to, I usually give integer-type variables a default value of zero. You can also declare strings and arrays using the appropriate brackets.

i = 5 j = 6
k = i + j
y = [1,3,5,8]
x = ('Emanuel')

3. Output

To output a variable or just some text, you can use the print class. Remember you can always combine several variables or variables with text by concatenating using the plus sign.

print ('Hello World!') print ('Hello, ' + x)
print (k)
print (y)
print (y[2])

4. Input

I'll be Continue reading "I DON’T SPEAK GERMAN (BUT I CAN IF YOU LIKE)"

I DON’T SPEAK GERMAN… But I can if you like

--Originally published at Coding The Future

If you are a Lady Gaga fan, you are probably familiar with her famous line "I don't speak German, but I can if you like" from her song SchieBe. This lyric line has always intrigued me, but it has acquired a new meaning since I started programming. Why? Because once you learn an object-oriented language, all others come naturally in a matter of days.

I started coding on Python 3 for the first time last week, and coming from C# on Visual Studio 2008 felt like a natural transition. All the syntax is pretty much the same, and some is even simpler, which is an amazing thing!

I have taken the time to compile the most basic syntax that I've learned on Python so far. Enjoy!

1. Comments

When we think about coding, commenting often goes as an underestimated feature. Consequently, I decided to start my post with comments.

#COMMENTS: To comment, use a number sign and then write your comment.

2. Declaring variables (and arrays)

Unlike other programming languages, I've realized that on Python, you don't have to declare the variable type when declaring a variable. To declare a variable, just type the name, and if you want to, give it a value. Even though you don't need to, I usually give integer-type variables a default value of zero. You can also declare strings and arrays using the appropriate brackets.

i = 5
j = 6
k = i + j
y = [1,3,5,8]
x = ('Emanuel')

3. Output

To output a variable or just some text, you can use the print class. Remember you can always combine several variables or variables with text by concatenating using the plus sign.

print ('Hello World!')
print ('Hello, ' + x)
print (k)
print (y)
print (y[2])

4. Input

I'll be Continue reading "I DON’T SPEAK GERMAN… But I can if you like"

I DON’T SPEAK GERMAN… But I can if you like

--Originally published at Coding The Future

If you are a Lady Gaga fan, you are probably familiar with her famous line "I don't speak German, but I can if you like" from her song SchieBe. This lyric line has always intrigued me, but it has acquired a new meaning since I started programming. Why? Because once you learn an object-oriented language, all others come naturally in a matter of days.

I started coding on Python 3 for the first time last week, and coming from C# on Visual Studio 2008 felt like a natural transition. All the syntax is pretty much the same, and some is even simpler, which is an amazing thing!

I have taken the time to compile the most basic syntax that I've learned on Python so far. Enjoy!

1. Comments

When we think about coding, commenting often goes as an underestimated feature. Consequently, I decided to start my post with comments.

#COMMENTS: To comment, use a number sign and then write your comment.

2. Declaring variables (and arrays)

Unlike other programming languages, I've realized that on Python, you don't have to declare the variable type when declaring a variable. To declare a variable, just type the name, and if you want to, give it a value. Even though you don't need to, I usually give integer-type variables a default value of zero. You can also declare strings and arrays using the appropriate brackets.

i = 5
j = 6
k = i + j
y = [1,3,5,8]
x = ('Emanuel')

3. Output

To output a variable or just some text, you can use the print class. Remember you can always combine several variables or variables with text by concatenating using the plus sign.

print ('Hello World!')
print ('Hello, ' + x)
print (k)
print (y)
print (y[2])

4. Input

I'll be Continue reading "I DON’T SPEAK GERMAN… But I can if you like"

I DON’T SPEAK GERMAN… But I can if you like

--Originally published at Coding The Future

If you are a Lady Gaga fan, you are probably familiar with her famous line "I don't speak German, but I can if you like" from her song SchieBe. This lyric line has always intrigued me, but it has acquired a new meaning since I started programming. Why? Because once you learn an object-oriented language, all others come naturally in a matter of days.

I started coding on Python 3 for the first time last week, and coming from C# on Visual Studio 2008 felt like a natural transition. All the syntax is pretty much the same, and some is even simpler, which is an amazing thing!

I have taken the time to compile the most basic syntax that I've learned on Python so far. Enjoy!

1. Comments

When we think about coding, commenting often goes as an underestimated feature. Consequently, I decided to start my post with comments.

#COMMENTS: To comment, use a number sign and then write your comment.

2. Declaring variables (and arrays)

Unlike other programming languages, I've realized that on Python, you don't have to declare the variable type when declaring a variable. To declare a variable, just type the name, and if you want to, give it a value. Even though you don't need to, I usually give integer-type variables a default value of zero. You can also declare strings and arrays using the appropriate brackets.

i = 5
j = 6
k = i + j
y = [1,3,5,8]
x = ('Emanuel')

3. Output

To output a variable or just some text, you can use the print class. Remember you can always combine several variables or variables with text by concatenating using the plus sign.

print ('Hello World!')
print ('Hello, ' + x)
print (k)
print (y)
print (y[2])

4. Input

I'll be Continue reading "I DON’T SPEAK GERMAN… But I can if you like"