Loops on Python

Hello everybody in this lesion we are going to talk about for and while loop. Ok  loop are used if we want to repeat our code.In this case we are not going to write the same codes a lot of times but we have to use loops.We use for to repeat our codes for example 8 times to do this we use a code called range, and we use while True to repeat our codes forever.We can use while True for creating programs that not will be closed when are executed the codes at the end of the line.

for i in range(12): #It will repeat the code on it 12 times

print(This output will be repeated 12 times”)

while True:

print(“This program will be executed forever”)

Thanks for reading!! I will see you in the next lesion

Conditional using Python

Hello to everyone here we have another lesion on Python. I’am today are going to talk about Conditional. So in Python we have three type of Conditional. The first is “if“, that is the first condition used on Python. For the rest of condition   “elif”   or “else” .

ans=input(Is your birthday? (y/n)”#The program is asking about your birthday 

if   ans==“y”# if is the first condition that we use on python! If the user input is y

             print(“Happy birthday!!” #the output is “Happy birthday!!”

elif ans==“n”#When the input is not predicted in  if ,we use elif (for another possible                 print(“When is your birthday?”)                                                                            input)

else:                         #We use else for including all other possible inputs

print(“Sorry i didn’t  get that!”)

 

           

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.

 

Editor vs Shell

Ok everybody now we are going to see the difference between shell and editor. Editor is  good for writing  a good program ,because you can save and edit it.In case you are tired or want to write later Editor is perfect.If you want to run something rough is more easier with Editor.Shell  is different by Editor.In shell you can write code for testing if the program can run.But you can’t save or edit it.In the other lesion we are going to use editor.If you haven’t download python idle here is the link with the instruction https://thecomputerworldblog.wordpress.com/2016/09/11/how-to-install-python-idle/.

How to install python idle?

Ok first of all visit this link https://www.python.org/downloads/windows , here you are going to download python 3.6.0a2. I am recommend this because i have no experience with other version such as python 3.6.0a3 or python 3.6.0a4. This is important,for example python 3.5.2 have problem with the module socket(I’am going to explain to you in the next lesions),as result you couldn’t use your python idle for creating any new program,the same problem might be with the higher version of python. 3.6.0a2 has not this  problems.I don’t recommend to you the lowest version like python 2.Python 3 is more easier to use.Python programming is more easier than any other language because has simple syntax.For more in the next lesion.

Why Python?

Before i go to explain to you why i chose Python,lets see what Python is.
So,Python is was conceived in the late 1980s, and its implementation began in December 1989 by Guido van Rossum at Centrum Wiskunde & Informatica in the Netherlands as a successor to the ABC language capable of exception handling and interfacing with the operating system Amoeba.Van Rossum is Python’s principal author, and his continuing central role in deciding the direction of Python is reflected in the title given to him by the Python community, benevolent dictator for life (BDFL).Python is a widely used high-level, general-purpose, interpreted, dynamic programming language.Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than possible in languages such as C++ or Java.The language provides constructs intended to enable writing clear programs on both a small and large scale.For more we are going to talk in the other lesions.

Physical Topology

The term physical topology refers to the way in which a network is laid out physically.Two or more devices connect to a link: one or more links from a topology. The topology of a network is the geometric representation of relationship of all the links and devices to one another.There are four possible basic topologies:mesh,star,bus,and ring.
In mesh topology, every device has dedicated point-to-point link to every other device.In a star topology each device has a dedicated point-to-point link only to a central controller,usually called hub.A bus topology uses multipoint link.One long cable, called bus, acts as a backbone to link all devices in a network.Nodes are connected to the bus cable by drop lines and taps(connectors).
In ring topology, each device has a dedicated point-to-point connection with only the two devices on either side of it.A signal is passed along the ring in one direction, from device to device, until it reaches its destinations.Each device in the ring incorporates a repeater.When a device receives a signal intended for another device, its repeater regenerates the bits and passed them along.
Each topology has its own advantages and disadvantages.A mesh guarantees that each connection can carry its own data load, eliminating traffic problems.It also robust in the sense that if one link becomes unusable,it does not incapacitate the entire network.The main disadvantages of mesh topology are related to the amount of cabling and the number of input/output ports required.
A ring relatively easy to install and configure.In addition,fault isolation is simplified.However,a break in the ring(such as a disabled station)can disable the entire network.The weakness can be solved by using a dual ring or a switch capable of closing off the break.Ring topology was prevalent when IBM introduced its local-area network Token Ring.Today,the need for higher-speed network has made a topology less popular.
A bus topology can be installed easily.Backbone cable can be laid along the most efficient path, then connected to nodes by drop lines of various lengths.However ,a fault or break in the bus cable stops all transmissions, between even between devices on the same side of the problem selection.Today the most common topology in high-speed  local-area networks is a star.A star topology is less expensive than a mesh topology,but has most of advantages of the latter.One big disadvantages of a star topology is the dependency of the whole topology on
one single point,the hub.If the hub goes down,the whole system is dead.However,the low cost of a star topology and ease of installation and scalability has made the star topology the only common topology.