Create a file (e.g. hello_world.py) in a text editor or a python editor if you have one installed (pick one if you don't - SublimeText, Eclipse, NetBeans, SciTe... there's many!)
hwld = 'Hello world'
print(hwld)
Note that python variables do not need to be explicitly declared; the declaration happens when you assign a value with the equal (=) sign to a variable.
The output of the above two lines of code is that the string "Hello World" will be displayed.
Functions written in Python can be used in iPython also.
In this instance, you can use run your saved file 'hello_world.py' in IPython like so:
In [1]: %run hello_world.py
#run file to get output below
Hello world
In [2]: wld
#show what value of wld var is
Out[2]: 'Hello world'
In [3]: %whowld
#display info on variable wld (name/type/value)
Variable Type Data/Info
----------------------------
wld str Hello world
If you wish you can use two variables, e.g one for hello and one for world and concatenate them using the plus (+) sign:
h = 'Hello '
w = "world!'
print(h+w)
#this will also output Hello World, only this time with an exclamation mark..