python
--------------------------------------------------------------
www.python302.tk
python302@gmail.com
--------------------------------------------------------------
ALL FOR YOU SPIDY
--------------------------------------------------------------
Disclaimer: This paper is not to be copied, or used on any
website without my permission, consequences will occur
if it has been found on ANY website. Only time it is
allowed to be used on a website is with my permission, and
proper credit must be given.
--------------------------------------------------------------
1.the question comes what exactly is python?
well my answer is it is a object oriented,scalable,
platform independant,quick and easy to use programming
language.
last but not the least it is a open source software
well supported by the G.N.U.i love freedom.
2.which operating system does it most suits?
well my answer to this question is :-
it works well on linux,windows,appale mac to sun solaries,
as well as other linux distros.
the language is supported for coding on
text editors like like-VI s EMAC`S.
3.where can i get python?
well one can eaisly obtain python frm www.python.org
4.why python?
well answer to this question you will find after executing
sum python codes at later section.you will realise although
python has come frm "C" it`z codes are easy to
write as that of "c" and other languages like PERL
RUBY or DIAMOND.(at higher level of programming)
---------------------------------------
python prompts:--
well python has two prompts in it
>>(primary prompt)
it appears every single time python interpretor begins
...(secondry interpretor)
it appears in case of conditionals
i will tell u about it in later part of tutorials
-------------------------------------------------
comment in python:-
#(hash operator is used to give comment in python)
example:-
>>print "no women no cry" #a comment
no women no cry
>>3+2 #adding two numbers
5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
------------------------------------------------------
HEY LET`Z LOOK AT SUM EASY PYTHON COMMANDS
------------------------------------------------------
---------------------
TYPE COMMAND
---------------------
1.CODE-
>>TYPE(1)
<type 'INT'>
2.CODE
>>TYPE("A")
<type 'STR'>
3.CODE-
>>TYPE(2.3)
<type 'float'>
well this type command is wonderful it tell u about
the nature of a variable.
kool isn`t it..........
----------------------------
print command
-----------------------------
let`z execute a simplest code ever written
>>print "hello world!"
hello world!
horrey, spidy isn`t it cool
s easily executable
---------------------------
little magic with strings
---------------------------
addin two strings :-(string concatenation operator)
well the string concatenation operator
combines strings togather.
code:-
>>a="long"
>>b="live"
>>c="linux"
>>d=a+b+c
print d
long live linux
>>a="long"+"live"+"linux"
>>print a
long live linux
adding string and a string (concatenation):-
>>a="python"
>>b="302"
>>c=a+b
>>print c
python302
the repition operator:-
>>print "spidy rock`z"*4
spidy rock`zspidy rock`zspidy rock`zspidy rock`z
-----------------------------------------------
python keywords
-----------------------------------------------
to my knowledge python has 28 keywords.
they are:::----
and continue else for import not raise
assert del except from in or return
break elif exec global is pass try
def class finally if lambda print while
================================================== =====
==========
strings
===========
well when it comes to strings python has an edge
>>1+1
2
a simple calculator stuff
>>2*2
4
>>3**2
9
isn`t it kool!!!!!
yeps it is
...............
python supports complex numbers as well
...............
>>a=3+4j
>>a.real #to find real part of a
3
>>a.imag #to find imagenary part of a
4
>>abs(a) # sqrt(a.real**2 + a.imag**2)
5
izn`i it a kool stuff!!!!!!!!!!!
---------------------------------
///again python string///
---------------------------------
::::slice operator::::
well it is one of the koolest feature i have found in
strings check this out.
>>aword="spidypy"
aword[3] #starts counting from zero and prints word at 4th place
'd'
>>aword[:2] #starts counting from 1 and outputs 1st two words
'sp'
>>aword[2:] #starts counting from 1 and prints out words excluding
1st two words
'idpy'
>>aword[2:]+aword[:2]
'spidypy'
isn`t it kool !!he he!!