input

Mathematical Programming

Prompt user for input. Default: numeric (returns parseFloat). With 's': returns string. Pauses execution until the user responds in the console.

Syntax

input('prompt')
input('prompt', 's')

Examples

n = input('How many items? ')
▶ Run
name = input('Enter name: ', 's')
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.