[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

a. True

b. False

3 / 40

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

4 / 40

4. Who developed Python Programming Language?

5 / 40

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

6 / 40

6. Python is an interpreted programming language

7 / 40

7.

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

8 / 40

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

9 / 40

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

 

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. A variable name cannot start with a number

14 / 40

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

15 / 40

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

16 / 40

16. Snake Case
Each word is separated by an underscore character:

17 / 40

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

18 / 40

18.

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

19 / 40

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

20 / 40

20. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

21 / 40

21. Comparison operators are not  used to compare two values

22 / 40

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

23 / 40

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

24 / 40

24.

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28. python file can also run on command line

29 / 40

29. Python can be install on both  Linux and  Windows

30 / 40

30. Comments starts with a #

31 / 40

31. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

32 / 40

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

33 / 40

33.

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

a. Define

b. DEF

c. def

d. Def

34 / 40

34.

 ____________________ 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

35 / 40

35. Most recent major version of Python is Python 3

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. You can also have an else without the elif

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.