Вопрос

I want to get a Number Using "Input" Command In Mathematica and Put it in a Variable.But When I Use This Command And Enter a Number,It Returns "Null".Here's the Code:

In[1]:= var = Input["Please Enter an Integer"];
        Sqr = var^2
Out[2]:= Null^2
Это было полезно?

Решение

Hummm. I just tried this

In[1]:= var = Input["Please Enter an Integer"];
Sqr = var^2

Out[2]= 121

Maybe try starting Mathematica fresh, just type exactly your two lines of code, hit shift and enter, tap the 1 key twice to see 11 in the input box and click the OK button. Don't do anything else, no extra mouse clicks, no executing a bunch of stuff first and report what happens.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top