[Tutorial] Basics of Python No 1

???Roun512 [roun512]
11 years ago | edited 11 years ago

0

![Image](http://1.bp.blogspot.com/-mRQ7NFMsC9Y/T4pps50d1kI/AAAAAAAAAus/3OHtj374r9M/s400/pythonlogo,Python,%D9%83%D8%AA%D8%A7%D8%A8+%D8%AA%D8%B9%D9%84%D9%8A%D9%85+%D8%A7%D9%84%D8%A8%D8%B1%D9%85%D8%AC%D9%87+%D9%88%D8%A8%D8%A7%D9%84%D9%84%D8%BA%D9%87+%D8%A7%D9%84%D8%B9%D8%B1%D8%A8%D9%8A%D9%87.jpg)[/center]
#.Introduction[/center] ##.Python is one of the Hight-Level Programming language that is simple to write and read. ##.It can be Used to Create Programs , Web Applications. ##.Python is very Case Sensitive. In this Tutorial i will show only basics of python.
- echo/print command[/center] First off , To print something to the screen which is pretty important in most of cases we can use print or echo command and that how it works ```print("Hello, World");``` That will print the sentence between the 2 quotes to the screen and don't forgot to add semi-colon ( ; ) in the end always so it will print ```Hello, World``` same as echo command ```echo "Hello, World";``` Will print out ```Hello, World``` [center]- Declaring a variable
To Declare a variable we can use the name of it then = sign then the value And this an example ```foo = "Hello, World";``` in this case foo is equal to the sentence Hello, World So if we printed foo to the screen like this ```foo = "Hello, World"; print(foo);``` It will print out ```Hello, World``` [center]- Math Using Python
Math in python is easy and important at same time because almost any program requirs Math and you can do it in this way ```print (1 + 2);``` Remember to not add quotes ( " ) in Math like above syntax so it will print out ```3``` Things you Must know is : + is addition - is subtraction / is division * is multiplication -- Note: Python uses * instead of x because we can declare x as variable. ** is Exponentiation -- it raise the first number ( base ) to the power of second number ( exponent ). % is Modulo or modulus -- it returns the number that is left after the division. More into Math is by assigning Math values to the variable like ```foo = 5 / 5; print(foo);``` will print on the screen ```1``` and here is another way to do Math in Python ```foo = 1 + 4; bar = 4; print(foo - bar);``` so it will print values of foo minus value of bar it will print ```1``` Here is another example using Exponentiation Operator ```foo = 5 ** 2; print(foo);``` the above syntax means 5 * 5 so it will print ```25``` and here is another one using Modulo Operator ```foo = 10 % 3; print(foo);``` So the above syntax will return the remainder left over by integer division so it will print ```1``` since it left 1 to become 10 And we can use any Math Operation Thank you for reading , More will be posted with better reading quality :D & Hope you understand it. [center] Sorry if their is any mistake

8replies
7voices
212views
Gninja
11 years ago

0

Nice, simple and easy to follow…..I like it. I’m looking forward to seeing more

J [ColdIV]
11 years ago

0

I really like Python but I didn’t take the time to learn it yet. But this tutorial is not even covering the basics.. that’s just stuff you can do in almost every programming language. So I’m certainly looking forward for more and I hope the following will help me with Python ;)

guuf
11 years ago

0

roun512, some of the bigwigs in the international hacking world/community recommend this language for beginning hackers so Bravo! Great start.

dalou
11 years ago

0

ColdIV, if you want to learn python easy and free check out Codecademy

???Roun512 [roun512]
11 years ago

0

[quote=ColdIV]I really like Python but I didn’t take the time to learn it yet. But this tutorial is not even covering the basics.. that’s just stuff you can do in almost every programming language. So I’m certainly looking forward for more and I hope the following will help me with Python[/quote]

Ya i know it almost in any language but some people don’t know any language so this is a good start i think and next one will be tomorrow i think :) and again i apology if u guys don’t understand it ( My Native language is not english )

J [ColdIV]
11 years ago

0

@dalou Thank you for the link, I already got some sites for it but one more is always nice ;)

@roun512 Yea, I guess for people who are new to programming this might be helpful but then you could have put functions and loops in it as well I guess. Well I will see if your next tutorial helps me more, I already looked through some Python scripts so I already got some basic input ;)

DaGr8Kornolio
11 years ago

0

I agree with @ColdIV… You need more stuff. What make python different from other languages… Is it compiled or interpreted? I look forward to read you other tutorials.

Thanks,
DaGr8

[IAmDevil]
11 years ago

0

Good tut there roun512 !!!
Some loops would have been great !!!!
Want to see more !!;)

You must be logged in to reply to this discussion. Login
1 of 9

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss