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 — write your code yourself and have it checked. The editor is empty; you write everything, including the reading. There are two types of parts: Most you read the values yourself input() a — the check feeds in fixed inputs and compares your output character by character, so give only what is required. With the other parts you define the data yourself (e.g. B. your own list) and follow along for above - there the test directly checks your data structure and output.

Part 1 — Numbers 1 to n

The classic counting loop with range().

Exercise

  1. Read a whole number first int(input()) there.
  2. Run with one for-Loop over the numbers from 1 up to the read number (inclusive) and output each number on its own line. Remember that the top end at range() is exclusive.

Example: input 5 → the lines 1, 2, 3, 4, 5. At 3 only until 3.

Part 1 — Your Code

Loading Python…
Output

    

Part 2 — List of names

Create your own list and iterate over it.

Exercise

  1. Define yourself a list namen with three names (Strings) — you choose the names freely. Here will nothing read in.
  2. Go with one for-Loop through the list and print each name on its own line.

The test checks that namen is a list of three strings and that your output contains exactly these names - each on its own line, in list order.

Part 2 — Your Code

Loading Python…
Output

    

Part 3 — Sum of four numbers

Accumulator pattern in a for loop.

Exercise

  1. Start with a sum of 0. Then run with one for-Small exactly four times and read an integer in each run int(input()) one (a total of four input()-views).
  2. In the loop block, add each number read in to the running total.
  3. Give in the end only the sum.

Example: inputs 2, 4, 6, 8 → Output 20.

Part 3 — Your Code

Loading Python…
Output

    

Part 4 — Even numbers up to n

range() with step size.

Exercise

  1. Read a whole number first int(input()) there.
  2. Give with one for-Loop only that even Numbers from 2 up to and including the read number - each on its own line. Tip: range() takes a step size as the third parameter with which you can skip every second number.

Example: input 10 → the lines 2, 4, 6, 8, 10. At 6 only until 6.

Part 4 — Your Code

Loading Python…
Output

    

Part 5 — Count letters

Iterate over a string.

Exercise

  1. Read along input() one after the other first that Word and then that Letters (in that order) and start with a counter of 0.
  2. Run with one for-Loop over the characters of the word and increase the counter by 1 whenever the current character is the same as the letter you are looking for.
  3. Give in the end only the number.

Example: word Banane, letter a → Output 2. The comparison is case-sensitive — for words Apfel and letter a is the result 0 (the big one A doesn't count).

Part 5 — Your Code

Loading Python…
Output

    

Part 6 — Even or Odd?

Run over your own list and classify each item.

Exercise

  1. Define yourself a list zahlen with at least three integers — you choose them freely. Here will nothing read in.
  2. Give with one for-Loop exactly one line for each number: <zahl> ist gerade and. <zahl> ist ungerade. You can tell whether a number is even by looking at the remainder when divided by 2 (modulo operator %): if the remainder is 0, it is even.

Example: At zahlen = [1, 2, 3, 4, 5] the test expects the lines 1 ist ungerade, 2 ist gerade, 3 ist ungerade, 4 ist gerade, 5 ist ungerade. Pay close attention to the text “is even” or “is odd”.

Part 6 — Your Code

Loading Python…
Output

    

Report as PDF

Document and download your results.

Module overview

PartStatus
Part 1: 1 to nOpen
Part 2: NamesOpen
Part 3: TotalOpen
Part 4: Even numbersOpen
Part 5: Counting lettersOpen
Part 6: Even/OddOpen

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.