Quizzy

Topic: Python (beginner)

1. what is the output of the following code

>>> a = "hello"
>>> b = "world"
>>> print(a+b)

helloworld

hello world

hello+world

hello + world

2. what is the output of the following code

>>> print(*range(10))

[1,2,3,4,5,6,7,8,9,10]

[0,1,2,3,4,5,6,7,8,9]

error

None

3. what is the output of the following code:

>>> fruits = ["banana","orange", "pinapple", "apple"]

>>> for i in fruits[:3]:
        print(i, end = ' ')

banana orange pinapple apple

banana orange pinapple

banana
orange
pinapple
apple

banana
orange

4. what is the function of "len" in Python ?

it calculate the length of every object

it calculate the length of every iterable object

there is no "len" function

none of these

5. what is the output of the following code:

>>> fruits = ("banana","orange", "pinapple", "apple")

>>> fruits[0] = "papaya"
>>> print(fruits)

("banana","orange", "pinapple", "apple")

papaya orange pinapple apple

error

none of these

6. Which of the following options result in exactly two lines

"Hello \n World"

"Hello World"

"Some\n text\n here"

"one \t two \t three"

7. Is list comprehension possible in Python?

True

False

8. Is "==" similer to "is" in Python?

True

False