# New to Python check this

13 Oct

After installing open python in command line.

Try this one liners

```>>> print "Hello, World!"
>>> 1 + 1
2
>>> 18294+449566
467860
>>> 6-5
1
(Subtraction)
>>> 5**2
25
(Exponentials e.g. this one is 5 squared)

>>> print "1 + 2 is an addition"
1 + 2 is an addition
(the print statement, which writes something onscreen)```

# Variables

```v = 1
print "The value of v is now", v
v = v + 1
print "v now equals itself plus one, making it worth", v
v = 51
word1 = "Good"
word2 = "Morning"
word3 = "to you too!"
print word1, word2```

## Loops

```a = 0
while a < 10:
a = a + 1
print a
if a > 5:
print "This shouldn't happen."
else:
print "This should happen."```

NOTE:

Indentation

One other point is that the code to be executed if the conditions are met, MUST BE INDENTED. That means that if you want to loop thenext five lines with a ‘while’ loop, you must put a set number of spaces at the beginning of each of the next five lines.

## Functions

`function_name(parameters)`

Define your own function like this

```def hello():
print "hello"
return 1234```