[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 statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

2 / 40

2. python has two primitive loop commands:

  • while loops
  • for loops

3 / 40

3.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

4 / 40

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

5 / 40

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

6 / 40

6. Python is an interpreted programming language

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. Python can be used on a server to create web applications?

16 / 40

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

17 / 40

17. Python has various versions available

18 / 40

18.

 ____________________ 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

19 / 40

19. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

20 / 40

20. Variable names are case-sensitive

21 / 40

21.

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

22 / 40

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

23 / 40

23. A variable name must start with a letter or the underscore character

24 / 40

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

25 / 40

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

26 / 40

26. Pip is  not a powerful package management system for Python software packages

27 / 40

27. Python can connect to database systems.

28 / 40

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

29 / 40

29. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

30 / 40

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

31 / 40

31. An array is a special variable, which can hold more than one value at a time

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

35. Comments starts with a #

36 / 40

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

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

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

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.