[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Indentation refers to the spaces at the beginning of a code line.

2 / 40

2. Comments can be used to make the code more readable.

3 / 40

3.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

4 / 40

4. Python has various versions available

5 / 40

5. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

6 / 40

6. Bitwise operators are used to compare (binary) numbers

7 / 40

7. An array is a special variable, which can hold more than one value at a time

8 / 40

8. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

9 / 40

9.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

10 / 40

10. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

11 / 40

11.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

12 / 40

12. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

13 / 40

13. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

14 / 40

14. The format() method takes the passed arguments

15 / 40

15. python file can also run on command line

16 / 40

16. The for loop does not require an indexing variable to set beforehand

17 / 40

17.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

18 / 40

18.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

19 / 40

19. The len() method to return the length of an array

20 / 40

20.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

21 / 40

21. You can also have an else without the elif

22 / 40

22. Strings in python are surrounded by either single quotation marks, or double quotation marks

23 / 40

23. What will be the output of the following Python code?

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

24 / 40

24. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

25 / 40

25.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

26 / 40

26. Comments can be used to explain Python code.

27 / 40

27. + operator is used  to get output of multiple variables

28 / 40

28. To write and execute code in python, we first need to install Python on our system.

29 / 40

29.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

30 / 40

30. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

31 / 40

31. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

32 / 40

32. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

33 / 40

33.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

34 / 40

34. An array can hold many values under a single name

35 / 40

35. Python has a set of built-in methods that you can use on lists/arrays

36 / 40

36. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

37 / 40

37. Python can be install on both  Linux and  Windows

38 / 40

38. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

39 / 40

39.

What is the data type of print(type(0xFF))

40 / 40

40.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.