[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Python can connect to database systems.

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14.

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

15 / 40

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

16 / 40

16. Which of the following is the correct extension of the Python file?

17 / 40

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

18 / 40

18. Comments starts with a #

19 / 40

19.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

20 / 40

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

21 / 40

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

22 / 40

22.

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

a. Define

b. DEF

c. def

d. Def

23 / 40

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

24 / 40

24. python file can also run on command line

25 / 40

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

26 / 40

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

27 / 40

27.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

28 / 40

28. Python can be used to handle big data and perform complex mathematics.

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

33 / 40

33. You can also have an else without the elif

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

40 / 40

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

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.