chevron_left chevron_right
Login Register invert_colors photo_library


Stay updated and chat with others! - Join the Discord!
Thread Rating:
  • 0 Vote(s) - 0 Average


Python 2.7 - Variables + Raw Inputs filter_list
Author
Message
Python 2.7 - Variables + Raw Inputs #1
First, some may automatically say this is from another forum. Well, I made it on that other forum, so I am not stealing anything! The other forum was called *Snip*, but I left. So there Tongue.

I decided to make a simple and quick Python tutorial that will help you get started on your coding adventure.

Frost's Beginner Python Tutorial!

What is Python?
Python, to me anyway, is a relatively easy-to-understand programming language, while remaining with smooth and powerful performance. It is highly recommended for beginners to learn this!

I am not really a coder myself, but if I need to make anything for my own benefit, I head straight to Python!

What are you going to learn?
First, I am going to throw an example of what you will be learning today out in the open:


[Image: pah932ljk65rwmrz2gk.png]

Most people can easily read this. However, it is OK if you cannot! I will go over each thing that is used in this script.

The Print Function:
This command is the simplest line of code in all of humanity. It will print out a desired string of text.
Code:
print "Hello VIPHackforums!"

Variables:
If you have been enrolled in a math class(Algebra 1 or higher), I hope you know what a variable is. However, I will say what it is anyway. A variable is basically a placeholder for a different value. These can be easily placed in python.
Code:
a = 'VipHackforums'
Code:
b = '1337 Hacking Skills'
[Image: qifU53x.png]
Raw Input:
If you can read simple code, this command is self explanatory. A raw input runs a string of text(or something else) to a user and lets the user respond. You can program how it responds using if statements. When you write out an if statement and you want it to do something based on an answer, you want to make sure you right it with two equal signs. Here is an example.
Code:
a = raw_input("What is two plus two?: ")
if a == '4':
     print 'Correct!'
else:
     print 'Wrong!'

Ect. things shown in the tutorial:
I mentioned the if statement and else statement. The else statement runs a string of code if the answer is anything else than the if. Also, I showed a string of text called sys.exit(). This shuts down the program, but remember to put "import sys" at the beginning of the script! Example:
Code:
import sys
sys.exit("This tutorial is over.")

Thanks for reading! I know I quickly went over the if and else statement, but if you like the tutorial I will go over the if-then and else statements in full detail! Thanks!

Made by: Frost

Download Link to Python 2.7:
http://www.python.org/download/releases/2.7/

P.S: This tutorial is for Python 2.7. I have grown used to it, and the Python 3 syntax is different. Thanks.

Reply

RE: Python 2.7 - Variables + Raw Inputs #2
Mentioning of another hack related forum removed.

Reply

RE: Python 2.7 - Variables + Raw Inputs #3
Mentioning of another hack related forum removed.

Reply

RE: Python 2.7 - Variables + Raw Inputs #4
(07-16-2013, 02:39 AM)Linuxephus Wrote: Mentioning of another hack related forum removed.

Sorry about that, I was just worried and I didn't want to cause confusion. I don't want to get a bad start on this forum Sad.

Reply

RE: Python 2.7 - Variables + Raw Inputs #5
(07-16-2013, 02:39 AM)Linuxephus Wrote: Mentioning of another hack related forum removed.

Sorry about that, I was just worried and I didn't want to cause confusion. I don't want to get a bad start on this forum Sad.

Reply

RE: Python 2.7 - Variables + Raw Inputs #6
(07-16-2013, 02:42 AM)Frost Wrote:
(07-16-2013, 02:39 AM)Linuxephus Wrote: Mentioning of another hack related forum removed.

Sorry about that, I was just worried and I didn't want to cause confusion. I don't want to get a bad start on this forum Sad.

No worries mate.

Reply

RE: Python 2.7 - Variables + Raw Inputs #7
(07-16-2013, 02:42 AM)Frost Wrote:
(07-16-2013, 02:39 AM)Linuxephus Wrote: Mentioning of another hack related forum removed.

Sorry about that, I was just worried and I didn't want to cause confusion. I don't want to get a bad start on this forum Sad.

No worries mate.

Reply

RE: Python 2.7 - Variables + Raw Inputs #8
Good basic explanation for Python beginners. Great job, Frost. :ok:
redN00ws
Cleveridge - Ethical Hacking Lab

I'm looking for freelance vulnerability testers. Interested? Contact me...

Reply

RE: Python 2.7 - Variables + Raw Inputs #9
Good basic explanation for Python beginners. Great job, Frost. :ok:
redN00ws
Cleveridge - Ethical Hacking Lab

I'm looking for freelance vulnerability testers. Interested? Contact me...

Reply

RE: Python 2.7 - Variables + Raw Inputs #10
Not a Well Explained tutorial but Good Job
My Blog: http://www.procurity.wordpress.com
Donations: 1HLjiSbnWMpeQU46eUVCrYdbkrtduX7snG

Reply






Users browsing this thread: 1 Guest(s)