If you are asking how to enter Python code in your shell, then try something like
python -c 'if x > y:
print(("x is greater than y")'
assuming you are using a Bourne-compatible shell (Linux etc). This has the major drawback that your Python code cannot easily contain a single quote (though if you know the quoting rules of the shell it's of course not impossible or even unobvious how to create an expression which evaluates to a single quote).
However, the common way to do this (and perhaps the only way on Windows?) is to type the Python code into a file and then run it with
python filename.py
where filename.py is the name of the file where you saved your Python code.
You can of course run simply
python
to enter the Python interpreter in interactive mode, where you can type in Python expressions and have them evaluated immediately. When you type an expression which ends with a colon, Python changes the prompt from >>> to ... to indicate that it expects one or more indented lines. (Type just a newline immediately at the ... prompt to exit this mode.)