IF you are awesome read this, ELSE go away.

--Originally published at Hackerman's house

I created an awesome program that uses the function IF and the function ELSE. It can be used to determine if one input is bigger than other. These inputs are related to the cost of a product, and the money a person can expend.

giphy (3)

There are 2 ways of using the functions if and else. In separate lines, and in the same line. Both ways are used in my program, each one show one sentence as an answer to the user.

If, else

Here is how the program works if the user has more money than the cost of the product.

IF yes

Here is how the program looks if the user doesn’t have enough money to buy the product.

IF no

I learn about this function using the Basic Python 3 course at Lynda.com

Thank you for reading me.

giphy (4)

 


Insanely Nasty Programming Utterly Trascendental

--Originally published at Cheba's Vlog

I just clickbaited you. Srry bruh. Or sys. Or trans non binary folk. I am not assuming your gender.

Here is my input: InmanI really do not have creativity right now, but you can crearly see how to put an input.

So now I have nothing more to show you; so I am going to review the new Purge movie:

It is not good; it is hilarious, but as a movie is pretty bad, like a B movie level of stuff.

You are still reading? Well you crearly wasted 30 seconds of your life… input is not that hard, it is harder to install python than creating an input, come on pal.

 


Screw things up until you get it right

--Originally published at Programming: First Steps

So  I was trying to use the topics :

  • Basic types and their use
  • Basic user output (print)

and then this happened:

screwthingsup

I was totally screwing things up cause i didn’t know i had to write the constants using the EXACTLY same characters that i put first including capital letters. I corrected it and i got it right!:)

screwbonito.png


Input = Putin (Illuminati)

--Originally published at Python & pugs

 

tumblr_nd2v3if21H1qdjbb7o1_500.gif

When you have an Input in a code, is just like if the code is asking you for something, and you’ll have to introduce it.

Just as easy as this:
age = input(“What’s your age? “)
//There you’ll have to give an answer like your age

After it, you can use the input in other part of the codes, just like in the next example:
print(“So your age is “+ age + ” years”)

There it is! Input in easy steps!

InputInput.2Input.3

 


SAY WHAT? Diving deeper into Input

--Originally published at Coding The Future

Image via GIPHY

Sometimes people say things I don't understand. However, when programming, understanding what a user is telling you is vital in order for a program to work.

In my last post, I talked briefly about the general syntax in Python 3, but this time I wanted to focus especially on user input, because I left this information incomplete last time. Let's get going!

Basic user input

Let's recall what we learned last time. When we ask a user for input, we can ask for several times of input. The most common ones are strings, which is just text; integers, which are numbers with no decimals, and floats, which are numbers with decimals.

Strings

When asking a user for input, the first thing that needs to be done is to declare a variable where the input will be stored. In the code below, a new variable called userName is declared, and then the input class is called. The text inside of the bracket is the prompt for the user to enter their name.

userName = input("What's your name? ")

Integers and Floats

Some times, input may include numbers, and even though they can be inputed as a string, they cannot be "treated" like numbers in that situation. In other words, let's say you are asking the user for their age and it will be stored in a variable called userAge, and then you want to add 10 to the value inputed. If the user input is stored in a string-type variable, you will not be able to add text to a number. For this reason, we have to specify that the input will be of type integer. To do this, you need call the int class and insert the input class within it.

userAge = int(input("How old are Continue reading "SAY WHAT? Diving deeper into Input"

SAY WHAT? Diving deeper into Input

--Originally published at Coding The Future

Image via GIPHY

Sometimes people say things I don't understand. However, when programming, understanding what a user is telling you is vital in order for a program to work.

In my last post, I talked briefly about the general syntax in Python 3, but this time I wanted to focus especially on user input, because I left this information incomplete last time. Let's get going!

Basic user input

Let's recall what we learned last time. When we ask a user for input, we can ask for several times of input. The most common ones are strings, which is just text; integers, which are numbers with no decimals, and floats, which are numbers with decimals.

Strings

When asking a user for input, the first thing that needs to be done is to declare a variable where the input will be stored. In the code below, a new variable called userName is declared, and then the input class is called. The text inside of the bracket is the prompt for the user to enter their name.

userName = input("What's your name? ")

Integers and Floats

Some times, input may include numbers, and even though they can be inputed as a string, they cannot be "treated" like numbers in that situation. In other words, let's say you are asking the user for their age and it will be stored in a variable called userAge, and then you want to add 10 to the value inputed. If the user input is stored in a string-type variable, you will not be able to add text to a number. For this reason, we have to specify that the input will be of type integer. To do this, you need call the int class and insert the input class within it.

userAge = int(input("How old are Continue reading "SAY WHAT? Diving deeper into Input"

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"