In a Pascal program, what does statement s1:=[0,3,7]开发者_如何学Python
mean ?
s1 is a Pascal set variable, and it is being initialised so that the set contains the members 0, 3 and 7.
Pascal has first-class support for sets. s1 is presumably declared as a set, like
var s1 : set of 0..10;
You can then write
if i in s1
// true when i is 0, 3 or 7
精彩评论