[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments can be used to explain Python code.

2 / 40

2.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

3 / 40

3.

 Select the correct example of complex datatype in Python

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

4 / 40

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

5 / 40

5.

Which function overloads the >> operator?

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

6 / 40

6.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

7 / 40

7. A variable name must start with a letter or the underscore character

8 / 40

8. Python has various versions available

9 / 40

9.

How to copy one list to another in python?

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

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. To write and execute code in python, we first need to install Python on our system.

12 / 40

12. The list’s remove() method only removes the first occurrence of the specified value.

13 / 40

13. print() function is often used to output variables.

14 / 40

14.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

15 / 40

15. Python can be treated in a procedural way, an object-oriented way or a functional way.

16 / 40

16.

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

a. 2

b. 3

c. 5

d. Multiple times

17 / 40

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

18 / 40

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

19 / 40

19. During Installation Make sure to select both the checkboxes at the bottom .

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

21.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

22 / 40

22. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

23 / 40

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

24 / 40

24. The format() method takes unlimited number of arguments

25 / 40

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

26 / 40

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

27 / 40

27.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

28 / 40

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

29 / 40

29.

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

30 / 40

30. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

31 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

32 / 40

32. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

33 / 40

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

34 / 40

34.

What is the data type of print(type(10))

35 / 40

35.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

36 / 40

36. python file can also run on command line

37 / 40

37.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

38 / 40

38. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

39 / 40

39. Python can connect to database systems.

40 / 40

40. Extension of all Python  Programme are .py

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.