What's the output of the following code?

array = [1, 8, 15] 
g = (x for x in array if array.count(x) > 0) 
array = [2, 8, 22] 
print(list(g))
  • [1]
  • [1, 8, 15]
  • [8]
  • [22]

What the difference between the following lines and in which one is better to use?

(x for x in "123456789")
[x for x in "123456789"]

Which of the following methods return a boolean value?

  • all()
  • max()
  • map()
  • any()

What's the type of the variable a?

a = ('inf')