[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

4 / 40

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

5 / 40

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

6 / 40

6.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

11 / 40

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

12 / 40

12. Comments starts with a #

13 / 40

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

14 / 40

14. Python relies on indentation?

15 / 40

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

16 / 40

16. Python has various versions available

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

22 / 40

22.

What is the value of the expression 100 / 25?

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

23 / 40

23. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

24 / 40

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

25 / 40

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

26 / 40

26. Most recent major version of Python is Python 3

27 / 40

27. python has two primitive loop commands:

  • while loops
  • for loops

28 / 40

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

29 / 40

29. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

30 / 40

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

31 / 40

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

32 / 40

32. The format() method takes the passed arguments

33 / 40

33.

What is the data type of print(type(10))

34 / 40

34.

 What is output of: 35 == 35.0

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

40. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

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.