Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 384 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Tutorial, Beginners | 1 |

#1
[Image: attachment-0001.png]
[Image: tqpbe.png]

Hello, and welcome AF,

Today I'll be going through some of the basics in Python, I'll also be showing where you can download the right Python version for your specific OS.
(I would recommend Python 2.7.3, since it's supported by more applications. You can read more on

[To see links please register here]

)

I would really recommend Python as one of their first languages if you are about to start. It's very easy and powerful, and I think you will learn a lot. Not only coding maybe, but logical thinking.

First: Download Python at:

[To see links please register here]


Secondary, install Python, its pretty easy I think you'll manage. :wink:

After that, please open up Python 'IDLE (Python GUI)' and it will look something like this:
(Without the coding)
[Image: python+learning.png]

So, now you've pretty much started up and you're ready to start coding!

You are now coding in the Python Shell, where you can create simple programs.
Start by writing: "print Hello World" and press enter. Python will print out the line "Hello World" for you.

It will look something like the following:

[To see links please register here]


As you see, i wrote:
print "Hello World, SLUAST"
and it print "Hello World, SLUAST"

Pretty basic right? But, its a good thing to know :wink:

There are some things you have to change to get some things work with the print statement. Such as, if you write it like this:

print 5

It will show only: 5
Right?
And then Python will print the 5, which is a number and can be added, multiplied, divided, and etc... with other NUMBERS. So, if you're trying to the equation: 22+3
Just write this: 22+3
and press enter. It will basically just print out what the sum of the two numbers added together.

Well, so if you are for an instance making a program to add strings and numbers. You might write something like this:

print "im elite,"+1337

Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
print "im elite"+1337
TypeError: cannot concatenate 'str' and 'int' objects

Well, you'll get that error. The part that begins with "File" says which file, and where in the file the error is located. Then it will show the code, and a little brief description on the error. This is an error where you cant add strings to integers (only numbers). And that's impossible right? Or? To solve this you can do one simple thing, by turning the user you want to use into a variable. One example is:

X = 1337

and press enter.

then write in following:

print "im elite"+X

You'll get the same error there, :wink:
Well, you haven't changed the variable X's number (1337) into a string by doing this you have to add these " ' ' ", like this:

X = '1337'

print "im elite "+X

will result in:

im elite 1337

So thats basically a very short tutorial for today, I hope to post one more tomorrow, on Friday, and hopefully a few more on the weekend. Then I'll be discussing some more friendly Python shells, third party IDLES, etc. I will also be concluding how to make your own little quiz, working with lists, more with variables and much much more!

Thanks for reading, please comment if you liked the tutorial and please check back in a few days. Have a nice day everyone!
Reply

#2
Excellent tutorial for people that have little or no experience with Python yet. Looking forward to more.
Also, I fixed a few grammatical errors. I recommend you use the [code] tag for showing snippets of code.
Reply

#3
I just did it and it makes sense. Awesome!
You sir have just started my coding adventure!
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through