I am planning on taking a semester of python in college. However, I do not know what to expect and I am only familiar with lua. Has anyone here taken or know python? How related is python to lua? Is python as easy to learn as lua or is it more complicated?
Has anyone taken Python? If so, what is it like?
-
Read The book ("Python Without Fear") I think it will teach you a bit. I don't know python, but I have read a bit into the book and it is kind of like Lua in a few ways. I think it is a good programming language. Function in python layout: def example():
-- I think there are no end for functions in python
--It is probably a bit more complicated though -
@RAYAN1565 Python is considered a beginner language by many people. Personally, it was the first language I learned to program before I moved onto Java and then Lua. It's pretty simple. As Dominus said, there are no ends, and instead of defining a function like
function foo()
end
Functions are defined in python like
def foo():(no end)
Python is very simple to learn but has a wide range of applications.
-
@LinKiNSpitZ do you think beginners will know what this is
def foo():
compared to
local function foo() end
Lua is more self explanatory and for that reason it's extremely easy to learn
-
@Zenith_Lord @incapaz
By the way guys, in Python you can't have a function with no instructions inside. At least, not like so:def foo(): # nothing foo()
This code would not compile, as Python wouldn't know if the function was meant to end before the next instructions (in this case the call to
foo
) or if you made a mistake while indenting your code. Remember that Python is a whitespace-significant language, and will not accept a program with incorrect indentation, and if it can't tell if your indentation is correct then it can't validate your program.To properly write a function with no instructions you must use the "
pass
" keyword. This basically tells Python that the block is empty and its contents will be added in the future:def foo(): pass foo()
This code would compile just fine.