Has anyone taken Python? If so, what is it like?


  • 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?


  • 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.


  • I've done a little python with the jupyter notebook, and I have to say, It's pretty simple. Before python I did TONS of javascript and gamemaker language (aka GML) and now I'm doing lua with all my knowledge of the other 2 languages for logic and stuff.


  • 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.


  • @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


  • @incapaz

    If they have experience in other languages they probably would because of the parenthesis

    0_1535980862773_upload-687980c5-094d-4471-bc40-5e7ba4888496


  • 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

  • Global Moderator

    @mlgwinners Yep. This is how you learn programming. :slight_smile:

  • Global Moderator

    @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. :slight_smile:


  • @incapaz Yes, i do.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.