[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comparison operators are not  used to compare two values

2 / 40

2. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

3 / 40

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

 

4 / 40

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

5 / 40

5. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

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

15 / 40

15. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

16 / 40

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

17 / 40

17.

What will be the output of below Python code?

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

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

18 / 40

18.

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

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

19 / 40

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

20 / 40

20. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

21 / 40

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

a. 5

b. 3

c. 6

d. 7

22 / 40

22.

What is the value of the expression 100 / 25?

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

23 / 40

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

24 / 40

24.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

25 / 40

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

26 / 40

26.

 ____________________ 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

27 / 40

27. Python is an interpreted programming language

28 / 40

28. Python can connect to database systems.

29 / 40

29. Variables that are created outside of a function

30 / 40

30. You can also have an else without the elif

31 / 40

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

32 / 40

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

33 / 40

33.

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

34 / 40

34. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

35 / 40

35. Python can be install on both  Linux and  Windows

36 / 40

36. Python relies on indentation?

37 / 40

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

38 / 40

38. Comments can be used to make the code more readable.

39 / 40

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

40 / 40

40. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

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.