Return to Tutorial

Coding in Python with artEoz – exercises


These exercises are not yet in their final format and this list will be gradually completed.

Highlightmarker-green24Variables and step-by-step mode

Highlightmarker-green24Use predefined or personnal resources

Highlightmarker-green24Arrays

Highlightmarker-green24Function calls and call stack

Highlightmarker-green24Objects

For any comments on the exercises, any new idea or implementation of illustration, please feel free to contact us! The forum or email is available.

Python arrays

◄ Previous exercise Next exercise ► In a new code frame  enter the following code and ask for the memory diagram construction: tab = [0]*5 mat = [[i*2 for i in range(3)] for j in range(6)] Play with the construction of arrays. Is it possible to build a triangular array? What is the representation of …

Python function calls and call stack

◄ Previous exercise Next exercise ► Open a new plain code frame and enter the following java code: def f(t): return t def maFonction(a): i = 25 + a i = f(i) return i c = maFonction(3) Select the Unreferenced objects in the options menu, play with the arrow buttons to run the code step-by-step. Observe …

Python objects

◄ Previous exercise Make sure you have the grec resourceIf necessary, see the Resources import webpage. Enter the following python code: alpha = Alpha(1,2) beta = Beta(alpha, Alpha(5,6)) a2 = Alpha(0,0) tableau = [Alpha(1,2), Alpha(3,4), Alpha(5,6)] a2 = Alpha(10, 10) An unreferenced object is a class instance which is no more referenced by a variable …

Python variables and step-by-step mode

Next exercise ► Make sure the Python icon is displayed at the top left of the page. Select a code example fron the drop down menu. The right frame displays the memory diagram corresponding to the execution of the first instruction of your code. You can execute the code step-by-step, select forward  or backward arrows …