[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

4.

What will be the output of below Python code?

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

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

5 / 40

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

6 / 40

6.

 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.

7 / 40

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

8 / 40

8. Variables that are created outside of a function

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

What is the value of the expression 100 / 25?

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

13 / 40

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

14 / 40

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

15 / 40

15. A variable name cannot start with a number

16 / 40

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

17 / 40

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

18 / 40

18. Python is an interpreted programming language

19 / 40

19.

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

20 / 40

20. You can also use the remove() method to remove an element from the array

21 / 40

21. Python relies on indentation?

22 / 40

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

23 / 40

23. Python is a  high-level programming language.

24 / 40

24.

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.

25 / 40

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

26 / 40

26. The for loop does not require an indexing variable to set beforehand

27 / 40

27.

Which is the correct operator for power(xy)?

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

28 / 40

28. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

29 / 40

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

30 / 40

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

31 / 40

31. Python will give you an error if you skip the indentation

32 / 40

32.

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

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

33 / 40

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

 

34 / 40

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

35 / 40

35. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

36 / 40

36. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

37 / 40

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

38 / 40

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

39 / 40

39. Comments starts with a #

40 / 40

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

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.