0
What is the output of the below code? >>import array >>> a = [1, 2, 3] >>> print a[-3] >>> print a[-2] >>> print a[-1]
2 Respostas
+ 9
The output will be:
Syntax error: Missing Parenthesis
You can try it yourself but don't forget to use parenthesis in your code.
Output:
1
2
3
And also please remove irrelevant tags from your question as it decreases the accuracy of search bar.
+ 4
Nishan ,
you don't need to import "module array" in your case, because it is never used in this code. what you create with:
a = [1, 2, 3]
is a regular list with 3 integer elements.