Error:Output argument "pythonAstResult" (and possibly others) not assigned a value in the execution with "internal.​PythonImpo​rter.analy​zePythonAs​t" function.

Hello,
I am getting the following error while trying to run the simple python code in "Python Importer".
Error:Output argument "pythonAstResult" (and possibly others) not assigned a value in the execution with "internal.PythonImporter.analyzePythonAst" function.
Code cannot be more simplified than this :-
var1 = 5
var2 = 2
sum_int = var1 + var2
print(sum_int)
I can't find what is the mistake. Can anyone please help.

3 件のコメント

Rajat Kumar Raghav
Rajat Kumar Raghav 2023 年 10 月 12 日
移動済み: Stephen23 2023 年 10 月 17 日
Never mind. I got it.
Mohammed
Mohammed 2023 年 10 月 17 日
移動済み: Stephen23 2023 年 10 月 17 日
what was the issue?
Actually Python Importer only works if codes are written in defined method, as shown below -
def sum2ints(var1, var2):
sum_int = var1 + var2
print(sum_int)
return sum_int
if __name__ == '__main__':
num1 = int(input('Enter the number1: '))
num2 = int(input('Enter the number 2: '))
output = sum2ints(num1, num2)
print('Final output is : ', output)

サインインしてコメントする。

回答 (0 件)

カテゴリ

製品

リリース

R2023b

質問済み:

2023 年 10 月 10 日

コメント済み:

2023 年 10 月 17 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by