Basic code

Hello everybody now you are going to learn your first code on python.Hope you like it!!

Have fun!! Let’s start our first programming hour!!

screenshot_2016-09-11-13-08-08-1

As you see in the photo this is a simple code.The syntax print()   is used to output the value inside the “”.You can write anything you want but you have to be careful for “” or ” but is incorrect if you “‘.Be careful to write the code exactly because the  python idle will make an error.

You can also create  variables .Variables are hmm let’s say a  new code that help us to define something,for example:

my_name=“John”

print(my_name) #output is John

be careful because the space will replace with “.I am going to show you another example of variables for example

a=“My name is John”

b=a

print(b) #output is “My name is John”

An other example of variables is :

a=4

b=5

result=a+b

print(result) # output is 9

Now we are going to request the user for getting the input.The syntax for making this is input().But we have to create a variable for defining.For example:

name=input(“Enter your name:”)#output “Enter your name:”,this is to say to user what he have to do

print(name)#output is the input name

Ok this were some basic code for more we are going to talk in the other lesion.I hope this course have helped you to learn something about python.See you in the next tutorial.Feel free to comment down below for every comment or suggestion that you might have.You can also follow us on facebook for more updates  

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s