Write first program on python
Today we will be learning how to code in python 3.6.4.
inside coding we will be learning how to print anything in python in different
ways because you can print in various ways in python.
Lets start with a simple program that prints hello world.
This is very easy in python. We don’t need to import or
include header files like in other programming languages to print. The
syntax is very simple to print.
Lets do an example to make it clear:
print(“Hello world”)
copy the above code in python IDLE and try yourself.
In an above example print(“
”) is a command in python to print anything.
Only the sentences inside (“
“) is printed.
There are various
ways to print in python. Lets print hello world in another way.
print(‘Hello world’)
copy the above code in python IDLE and try yourself.
lets compare the above two examples. On comparing we can see
that the first example has “ while the
second example has ‘. Actually both are
accepted in python 3.6.4.
And the best part about python is that you don’t need to
worry about terminating character like ‘;’ in C.
You may or may not put terminating character in python. Both
are accepted.
Comments
Post a Comment