Difference between revisions of "Create an Array"
From CompSciWiki
Line 23: | Line 23: | ||
print 'Program completed successfully.' | print 'Program completed successfully.' | ||
− | + | main() | |
}} | }} |
Revision as of 23:18, 3 April 2012
Back to the Program-A-Day homepage
ProblemTen students' grade are 56%, 34%, 75%, 89%, 78%, 87%, 71%, 67%, 98%, 85%
|
Introducing Array | |
---|---|---|
SolutionCompare to java array, Python array is much easier. We don't need to declare the variables and we also don't need to indicate the type of each array. Because the type of an array is automatedly set when we assign the value. So the code will be intArray = [56, 34, 75, 89, 78, 87, 71, 67, 98, 85]; | ||
Code |