I'm totally new in Python world.
I want to create a web application with some Python code behind. I want to use Python to control Raspberry Pi inputs and outputs etc.
There are Python 2 and Python 3 available. I've read some about these version, but I'm still not sure which version I should use.
It depends, what web framework you are going to use.
Some of them might have a bit limited functionality on Python 3 but still can be worth to use.
This could be case of Flask, which is very lightweight, provides all what you need, but according to heavy users lack in few small details complete support for Python 3. This situation is likely to be resolved in near future, but if you want to have it developed now, it is better to use the version of Python, which fits your web framework.
Comments on few (not all) web frameworks
Django
Very popular, but will force you to do things in Django style.
Final solution can become a bit heavier, then really necessary, this could be a problem on Raspberry Pi, which has very limited resources available.
Flask
Also rather popular (even though not as much as Django).
Gives you freedom to use only what you need.
Very good tutorials.
Most of the applications run under Python 2 and Python 3, few (supporting) libraries are told to be not ported completely yet (I cannot serve exactly which ones).
CherryPy
Minimalistic web framework, but with very good builtin HTTP and WSGI server.
Not so easy to find good tutorials, best is using (now a bit old) book about programming in CherryPy.
Note: By default, the applications are developed in debug mode and code is autoreloaded from disk. This disk activity can slow down on RPi and consume some energy, so if you have troubles with that, set the app to production mode.
Conclusions
My current choice is using Flask on Python 2.7, but this is partially due to a lot of legacy code I have developed in Python 2.7.
You shall make your decision about what framework you are going to use and check, what is status of Python 3 support.
Which Python version should I use with Raspberry Pi running web applications?