linux-python

in #python7 years ago

This blog is to give a brief code about python

the following are simple use of python command line..

python 2.7 interpreter introduction commands!
pg-48@pg48-Precision-Tower-3620:~$ python2
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.

print "Hello python!"
Hello python!
x = 4
x
4
y = 2
y
2
x+y
6
x-y
2
xy
8
x/y
2
x%y
0
x
*y
16

s = 'python'
s
'python'
s[0]
'p'
s[0:2]
'py'
s[2:5]
'tho'
x*s
'pythonpythonpythonpython'

list = [1,2.5,'python']
list
[1, 2.5, 'python']
list.append(x)
list
[1, 2.5, 'python', 4]

for i in range(10):
... print i
...
0
1
2
3
4
5
6
7
8
9

for i in range(10):
... print i*i
...
0
1
4
9
16
25
36
49
64
81

for i in list:
... print i
...
1
2.5
python
4

Sort:  

Congratulations @sirivellamadhu, you have decided to take the next big step with your first post! The Steem Network Team wishes you a great time among this awesome community.


Thumbs up for Steem Network´s strategy

The proven road to boost your personal success in this amazing Steem Network

Do you already know that awesome content will get great profits by following these simple steps, that have been worked out by experts?

Coin Marketplace

STEEM 0.25
TRX 0.20
JST 0.037
BTC 92599.05
ETH 3362.73
USDT 1.00
SBD 3.68