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
Functions are defined in python like
Python is very simple to learn but has a wide range of applications.
Python has a clean syntax and i think it's easier to learn than Lua, although you have to be careful with the indentation, because Python does not have marks to indicate where a function or cycle ends like Lua or Java.
I taught myself for a school project. Using that along with a mini-computer and bread board was prob one of the most coolest things in recent memory. After going into basics, try using PIL and do image cropping, edge detection, etc. It seems easy to replicate in photoshop but it was fun for meh
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.