[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. 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()

 

2 / 40

2.

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

a. [ ]

b. { }

c. ( )

d. None of the above

3 / 40

3.

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

4 / 40

4. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

5 / 40

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

6 / 40

6. Variables that are created outside of a function

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

13 / 40

13. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

14 / 40

14. Python allows you to extract the values into variables.

15 / 40

15. Most recent major version of Python is Python 3

16 / 40

16.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

17 / 40

17. A variable name cannot start with a number

18 / 40

18.

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.

19 / 40

19.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

20 / 40

20.

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.

21 / 40

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

22 / 40

22. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

23 / 40

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

24 / 40

24.

 What is output of: 35 == 35.0

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

25 / 40

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

26 / 40

26.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

27 / 40

27.

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

28 / 40

28. Operators are used to perform operations on variables and values

29 / 40

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

30 / 40

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

31 / 40

31. You can return a range of characters by using the slice syntax

32 / 40

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

33 / 40

33. Python can be install on both  Linux and  Windows

34 / 40

34. Extension of all Python  Programme are .py

35 / 40

35.

What will be the output of above Python code?

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

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

36 / 40

36. With the break statement we can stop the loop before it has looped through all the items

37 / 40

37. Python can be used to handle big data and perform complex mathematics.

38 / 40

38.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

39 / 40

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

40 / 40

40.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

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.