[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. You can also have multiple else statements on the same line:

2 / 40

2.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

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

8 / 40

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

9 / 40

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

10 / 40

10.

What will be the output of below Python code?

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

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

11 / 40

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

12 / 40

12.

 What is output of: 35 == 35.0

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

13 / 40

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

14 / 40

14.

What will be the output of below Python code?

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

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. Indentation refers to the spaces at the beginning of a code line.

19 / 40

19. Variable names are case-sensitive

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.

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.

22 / 40

22.

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

a. Define

b. DEF

c. def

d. Def

23 / 40

23. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

24 / 40

24. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

a. True

b. False

29 / 40

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

30 / 40

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

31 / 40

31.

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

32 / 40

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

33 / 40

33. Comparison operators are not  used to compare two values

34 / 40

34. python file can also run on command line

35 / 40

35.

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

36 / 40

36. An array can hold many values under a single name

37 / 40

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

38 / 40

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

39 / 40

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

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.