LoslegenKostenlos loslegen

Defining ranges

Ranges are an important concept in Julia, allowing you to quickly create an ordered collection of values. In this exercise, you want to generate a range of evenly-spaced points. Imagine if the spacing between each point was 1/3 - you would quickly find it hard to do this ourselves. This is where a range comes in - you can specify a start value, an optional step value, and an end value. Then, the range will automatically be generated for us.

There are two steps in the exercise below. In the first step, you will create and inspect a range with no step value specified. In the second step, you will create and inspect a second range, this time specifying a step value.

Diese Übung ist Teil des Kurses

Intermediate Julia

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Define the range in the variable x
x = ____

# Print the type of the range x
println(____(____))
Code bearbeiten und ausführen