[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Comments starts with a #

3 / 40

3.

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

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

4 / 40

4. Python is an interpreted programming language

5 / 40

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

6 / 40

6. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

7 / 40

7.

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

a. True

b. False

8 / 40

8.

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

9 / 40

9.

What will be the output of below Python code?

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

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

10 / 40

10. Who developed Python Programming Language?

11 / 40

11. Extension of all Python  Programme are .py

12 / 40

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

13 / 40

13. A variable name cannot start with a number

14 / 40

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

15 / 40

15. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

16 / 40

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

 

17 / 40

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

18 / 40

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

19 / 40

19. The len() method to return the length of an array

20 / 40

20.

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

21 / 40

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

22 / 40

22.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

23 / 40

23.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

28 / 40

28.

What will be the output of below Python code?

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

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

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. You can use the pop() method to remove an element from the array

31 / 40

31.

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

32 / 40

32.

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

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

33 / 40

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

34 / 40

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

35 / 40

35. Arrays are used to store multiple values in one single variable.

36 / 40

36.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

37 / 40

37.

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

38 / 40

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

39 / 40

39. Bitwise operators are used to compare (binary) numbers

40 / 40

40. python has two primitive loop commands:

  • while loops
  • for loops

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.