[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of below Python code?

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

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

2 / 40

2. Python can be used on a server to create web applications?

3 / 40

3.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

4 / 40

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

5 / 40

5. Variables that are created outside of a function

6 / 40

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

7 / 40

7. The length of an array is always one more than the highest array index.

8 / 40

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

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.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

11 / 40

11.

What will be the output of below Python code?

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

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

12 / 40

12.

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

13 / 40

13.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

14 / 40

14. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

15 / 40

15.

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.

16 / 40

16. Which of the following is the correct extension of the Python file?

17 / 40

17.

How to copy one list to another in python?

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

18 / 40

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

19 / 40

19. Python relies on indentation?

20 / 40

20.

What will be the output of above Python code?

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

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

21 / 40

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

22 / 40

22. Comparison operators are not  used to compare two values

23 / 40

23. Python  was created by Guido van Rossum, and released in 1999.

24 / 40

24. Arithmetic operators are used with numeric values to perform common mathematical operations

25 / 40

25. A variable name can only contain alpha-numeric characters and
underscores

26 / 40

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

27 / 40

27. Is there any comments in  following codes

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

 

28 / 40

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

29 / 40

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

30 / 40

30.

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

a. [ ]

b. { }

c. ( )

d. None of the above

31 / 40

31.

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.

32 / 40

32.

 ____________________ 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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

39.

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

a. True

b. False

40 / 40

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

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.