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.

Programming task — enter your code and have it checked. At the Reading-exercises (Parts 1, 2, 4, 5), the test feeds fixed inputs and compares your output character by character — so give only what is required. input(prompt) with prompt is allowed, the prompt is hidden. At the Definition-exercises (Part 3, 6) you define just the function — none input(), none print(); the test calls your function itself with fixed values and checks the return.

Part 1 — Function hallo(name)

Define a function, call it and use its return value.

TipExercise

  1. Write a function hallo(name) that exactly the text Hallo, <name>! return — the function itself should not print() call.
  2. Below the function definition, read a Name with input() one, call the function with it and save the return in a variable.
  3. Give this return with you print() out.

The following is read: 1 line (name). Exactly one line is output - upon input Mia therefore Hallo, Mia!.

Part 1 — Your Code

Loading Python…
Output

    

Part 2 — Function addiere(a, b)

Sum as return value.

TipExercise

  1. Write a function addiere(a, b), which is the sum of the parameters return.
  2. Below the function definition, read two integers one - each with int(input()), first a, then b — call the function and save the result in summe.
  3. Pass only summe out.

The following is read: 2 lines (a, then b). Example: 4 and 5 → Output 9.

Part 2 — Your Code

Loading Python…
Output

    

Part 3 — Function ist_positiv(zahl)

Just define — the check calls the function itself.

TipExercise

  1. Paper only the function ist_positiv(zahl), the True return, if zahl > 0 is, and otherwise False.
  2. You have to here read nothing and produce no output — none input(), none print().

The check calls your function with fixed values: ist_positiv(5) must: True result, ist_positiv(-3) and ist_positiv(0) each False (the zero counts not as positive).

Part 3 — Your Code

Loading Python…
Output

    

Part 4 — Function quadrat(zahl)

A bill as a function.

TipExercise

  1. Write a function quadrat(zahl), which returns the square of the number.
  2. Below the function definition, read an integer (int(input())), call the function and print its return.

The following is read: 1 Line (number). When entering 6 is the output 36, at -4 it is 16 (pay attention to the square, not the double).

Part 4 — Your Code

Loading Python…
Output

    

Part 5 — Function max_von_zwei(a, b)

Conditional return.

TipExercise

  1. Write a function max_von_zwei(a, b)that returns the larger of the two numbers. If the numbers are equal, return their common value.
  2. Below the function definition, read two integers (using int(input()), first a, then b), call the function and print its return.

The following is read: 2 lines (a, then b). Example: 8 and 3 → Output 8; at 2 and 9 → 9. At 5 and 5 is the output 5.

Part 5 — Your Code

Loading Python…
Output

    

Part 6 — Function rechner(a, b)

Two returns as tuples — just define.

TipExercise

  1. Paper only the function rechner(a, b), the two values returns: first the sum of the two parameters, then their product. In Python, you return multiple values by separating them with commas return write — the order decides the tuple.
  2. You have to here read nothing and produce no output — none input(), none print().

The check calls your function with fixed values and checks the returned tuple: rechner(2, 7) must: (9, 14) result, rechner(5, 6) must: (11, 30) result. Pay attention to the order: first sum, then product.

Part 6 — Your Code

Loading Python…
Output

    

Report as PDF

Document and download your results.

Module overview

PartStatus
Part 1: helloOpen
Part 2: addOpen
Part 3: is_positiveOpen
Part 4: squareOpen
Part 5: max_of_twoOpen
Part 6: calculatorOpen

Not all parts are completed yet - you can still create the report, which will then mark which parts are open.

Download PDF

Enter your name and download the report as a PDF.