[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

2 / 40

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

3 / 40

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

4 / 40

4. You can also have an else without the elif

5 / 40

5.

What will be the output of below Python code?

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

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

6 / 40

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

7 / 40

7.

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

a. True

b. False

8 / 40

8.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

9 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

10 / 40

10. Pip is  not a powerful package management system for Python software packages

11 / 40

11. Arrays are used to store multiple values in one single variable.

12 / 40

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

13 / 40

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

 

14 / 40

14.

 What is output of: 35 == 35.0

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

15 / 40

15.

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.

16 / 40

16.

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

17 / 40

17. Python can be install on both  Linux and  Windows

18 / 40

18.

 ____________________ 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

19 / 40

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

20 / 40

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

21 / 40

21. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

22 / 40

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

23 / 40

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

24 / 40

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

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. Extension of all Python  Programme are .py

27 / 40

27.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

28 / 40

28.

Which function overloads the >> operator?

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

29 / 40

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

30 / 40

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

31 / 40

31.

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.

32 / 40

32.

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

33 / 40

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

34 / 40

34. Comparison operators are not  used to compare two values

35 / 40

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

36 / 40

36. Python has various versions available

37 / 40

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

38 / 40

38. We can combine strings and numbers by using the format() method

39 / 40

39. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

40 / 40

40. python file can also run on command line

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.