[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

3 / 40

3. You can use the append() method to add an element to an array

4 / 40

4.

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

5 / 40

5. Python is an interpreted programming language

6 / 40

6. With the for loop we can execute a set of statements

7 / 40

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

8 / 40

8. Pascal Case
Each word starts with a capital letter:

9 / 40

9. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

10 / 40

10. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

11 / 40

11. Official site of python is www.python.org

12 / 40

12. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

13 / 40

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

14 / 40

14. 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

15 / 40

15.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

16 / 40

16. python file can also run on command line

17 / 40

17. You can use the pop() method to remove an element from the array

18 / 40

18.

How to copy one list to another in python?

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

19 / 40

19. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

20 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

21 / 40

21.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

22 / 40

22. The else keyword catches anything which isn’t caught by the preceding conditions.

23 / 40

23. Who developed Python Programming Language?

24 / 40

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

25 / 40

25.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

26 / 40

26. Camel Case
Each word, except the first, starts with a capital letter:

27 / 40

27. Python relies on indentation?

28 / 40

28.

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

29 / 40

29.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

30 / 40

30. 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

31 / 40

31. A variable name cannot start with a number

32 / 40

32. You can have if statements inside if statements, this is called nested if statements.

33 / 40

33. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

34 / 40

34.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

35 / 40

35. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

36 / 40

36.

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

37 / 40

37.

 Select the correct example of complex datatype in Python

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

38 / 40

38. Comments can’t be used to prevent execution when testing code.

39 / 40

39.

Which function overloads the >> operator?

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

40 / 40

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

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.