C is a procedural style language and Python is and object oriented style language, right?
C is a procedural language. Python is a procedural language that also supports object-oriented and (to some extent) functional programming.
I wouldn't worry about this as a beginner though. First because there are more basic things to learn before OOP and second because OOP isn't all that well defined (different people define "OOP" to include or exclude slightly different things) and support for OOP in a language isn't a simple binary yes/no thing. For example, C isn't normally considered an object-oriented language, but it is still possible to use some OOP-style design and techniques in C. (It is fairly common to see this done in C where OOP fits the programming problem well, for example in C bindings for GUI/Windowing libraries.)
Is C hard and time consuming to learn and code with compared to other good languages out there, I believe C is a low level language?
C is a relatively low-level language. This means you need to deal with low-level issues manually in C that are taken care of automatically in higher-level languages.
The one that makes probably the biggest practical difference is memory management. In C, you need to manually ask the operating system for memory as you need it and you are responsible for manually freeing memory that you are no longer using. For nontrivial problems, this means you need to write code carefully calculating how much memory you will need and checking for when you need to ask for more. If you're not careful it is also possible to lose track of memory you've previously allocated or simply forget to free it when you're done with it. This results in a type of bug called a "memory leak". Many programming languages handle memory allocation and reclamation automatically.
"Hard to learn" and "hard to use" are different things. C is fairly compact and straightforward; it doesn't take very long to learn the whole language. But it can take much longer to write a complicated program in C than in other languages simply because you may need to do a lot of manual work (like the memory management just described) that higher-level languages save you from having to do yourself. Even if you use libraries that do a lot of the work, they still usually can't completely hide the low-level things going on.
The difference can be quite dramatic. For example, consider a simple math problem: write a function that computes the
nth harmonic number, i.e., the sum $$1 + \frac{1}{2} + \frac{1}{3} + \dotsb + \frac{1}{n}$$. To make this a little more interesting, let's say the function should compute the result as an exact fraction, so it should find that $$1 + \frac{1}{2} + \frac{1}{3}$$ is exactly $$\frac{11}{6}$$ and not 1.833333.... If you do this in Lisp (a language with built-in rational arithmetic) then you're done in about ten seconds:
Code:
(defun harmonic (n)
(loop for k from 1 upto n sum (/ k)))
In other languages you would typically need to look up a library for doing rational arithmetic and figure out how to use it. Python has one in its standard library that isn't hard to use. So the Python version, after a minute or two of Googling, looks like this:
Code:
from fractions import Fraction
def harmonic(n):
return sum(Fraction(1, k) for k in range(1, n + 1))
For comparison, here's a C version using GMP (the GNU Multiple Precision library):
Code:
#include <gmp.h>
void harmonic(mpq_t result, long n)
{
mpq_t reciprocal, tmp;
mpq_init(result);
mpq_init(reciprocal);
mpq_init(tmp);
for (long k = 1; k <= n; ++k) {
mpq_set_si(reciprocal, 1, k);
mpq_swap(tmp, result);
mpq_add(result, tmp, reciprocal);
}
mpq_clear(reciprocal);
mpq_clear(tmp);
}
This is typical of what C code starts to look like when you begin programming with nontrivial objects, even when a library is doing most of the work.
Having said this, I think C (as opposed to C++) is well worth learning at some point, for various reasons. Just have the good sense not to use it for problems it isn't very well suited for.
What makes Python better than other object oriented and high level languages?
Python is a popular high-level language with clear syntax and fairly regular semantics. This means it is usually easy to understand what a given bit of Python code is supposed to do once you have learned the language. (There are languages that have complicated grammar rules and/or are full of special cases treated differently than everything else. Python is generally not like this.) The "popular" bit translates to lots of tutorials and lots of useful libraries. Python is often recommended for beginners for these reasons but it is also used for "real" programming jobs. For example, the software updater on my computer is a program written in Python.
I would not say that Python is better than other languages. Just that it is a good language overall and
one of the good places you could start to learn programming with. Python is not unique in this regard.
To give just one other example: you could consider Lua as a beginner language as an alternative to Python. Like Python, it is also fairly clear and high level and (from what I've seen of it) looks like it should be a nice, lightweight language to program in. I picked Lua specifically to mention here because you expressed an interest in game programming and one of the things Lua is known for is being embedded as a scripting language in game engines written in C and C++. So if you're interested in game programming, Lua could be one way to do that using an already existing game engine.