Installation Program_Execution Data_Structures Data_Input Data_Handling Functions Data_Manipulation

Goal

To develop a good and efficient "workflow" for programming in Python.

Additional Information

Here you can find additional information on ...

Writing a Function

  • Write a script (i.e. a Python Module) that plots a sine-wave.
  • Use your IDE of choice to turn this code into a function, with "frequency" and "duration" as the input parameters. The function should return two vectors, containing the time and the corresponding sine-values, respectively.
  • Set the defaults for frequency and duration to 0.5 Hz and 10 sec, respectively.
  • Test the function.
  • Use the debugger of the IDE to stop the program execution in the function, and inspect the current workspace.
  • Use the function you just wrote in another Python program.

Solution