Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is not really a Sage question. Anyway, use input in python.

In [1]: a = input('Enter number: ')
Enter number: 10

In [2]: a
Out[2]: 10

In [3]: a = input('Enter string')
Enter string: 'test'

In [4]: a
Out[4]: 'test'

In the sage notebook you can use the @interact decorator. See examples of it here.