Save / load workspace

Save your lab results on this server for 48 hours. Use the token to continue on another device. Anyone who knows the token can open your workspace.

Save workspace

A name is required when you first save and is then permanently bound to this workspace. Task values, entries and progress are saved together.

Load workspace

New workspace

Start with empty results and a name of your choice. Previously saved tokens remain valid until they expire. Unsaved changes in this tab will be discarded.

Saving also transfers any included measurement files and analysis videos to this server. Running simulations are saved as a set of results and displayed in a paused state when loaded.

Four small exercises that build on each other — at the end you have a finished dice class. From part 2 on, a button copies your code from the previous part.

Part 1 — The class Wuerfel

A blueprint with one attribute.

Exercise

Write the class Wuerfel. The constructor __init__ receives the parameter anzahl_seiten with the default value 6 and stores it in the attribute seiten.

Example Wuerfel().seiten yields 6, Wuerfel(4).seiten yields 4.

Part 1 — Your Code

Loading Python…
Output

    

Part 2 — The method maxwert()

A first method that returns a value.

Exercise

Copy your class from part 1 and add the method maxwert(). It returns the number of sides of the dice — the highest value it can show.

Example Wuerfel(4).maxwert() yields 4.

Part 2 — Your Code

Loading Python…
Output

    

Part 3 — The method wuerfeln()

Random dice values with NumPy.

Exercise

Copy your class from part 2 and add the method wuerfeln(). It returns a random integer from 1 up to and including the dice's number of sides.

Note Import numpy at the very top and use numpy.random.randint(low, high)The lower bound is included and the upper bound is excluded. Use 1 as the lower bound and the number of sides plus 1 as the upper bound.

Part 3 — Your Code

Loading Python…
Output

    

Part 4 — Two dice together

Using two objects from one blueprint.

Exercise

Copy your class from part 3 and write the function below it augensumme(seed). It first calls numpy.random.seed(seed) , then builds a four-sided and a six-sided dice, rolls the four-sided one first, then the six-sided one, and returns the sum of both rolls.

Note numpy.random.seed(seed) makes randomness repeatable: with the same seed the same numbers come up. That is how the check can recompute your result.

Part 4 — Your Code

Loading Python…
Output

    

Report as PDF

Document and download your solutions.

Module overview

PartStatus
Part 1: BlueprintOpen
Part 2: MethodOpen
Part 3: RollingOpen
Part 4: Two diceOpen

Not all parts are complete yet — the report can still be created.

Download PDF

Enter your name. The PDF contains your code, completion status, and a QR code for verification.