[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

2 / 40

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

3 / 40

3.

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

4 / 40

4.

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.

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

 

9 / 40

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

10 / 40

10. To insert characters that are illegal in a string, use an escape character

11 / 40

11. With the break statement we can stop the loop even if the while condition is true

12 / 40

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

13 / 40

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

14 / 40

14. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

19 / 40

19.

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

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

20 / 40

20. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

21 / 40

21. Extension of all Python  Programme are .py

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. Comments can be used to make the code more readable.

24 / 40

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

25 / 40

25.

Which is the correct operator for power(xy)?

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

26 / 40

26.

 What is output of: 35 == 35.0

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

27 / 40

27. Python relies on indentation?

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. Python is a  high-level programming language.

32 / 40

32.

What will be the output of below Python code?

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

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

a. 5

b. 3

c. 6

d. 7

38 / 40

38. Python can connect to database systems.

39 / 40

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

40 / 40

40.

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

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.