[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

2 / 40

2. Python can be install on both  Linux and  Windows

3 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

4 / 40

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

5 / 40

5.

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

a. Define

b. DEF

c. def

d. Def

6 / 40

6. Variables that are created outside of a function

7 / 40

7.

 What is output of: 35 == 35.0

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

8 / 40

8. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

9 / 40

9.

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

10 / 40

10. You can have if statements inside if statements, this is called nested if statements.

11 / 40

11. You can also have an else without the elif

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. Python can connect to database systems.

17 / 40

17.

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

18 / 40

18. Is there any comments in  following codes

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

 

19 / 40

19.

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

a. 2

b. 3

c. 5

d. Multiple times

20 / 40

20.

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

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

21 / 40

21. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

22 / 40

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

23 / 40

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

24 / 40

24. python has two primitive loop commands:

  • while loops
  • for loops

25 / 40

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

26 / 40

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

27 / 40

27. Extension of all Python  Programme are .py

28 / 40

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

29 / 40

29.

 ____________________ 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

30 / 40

30. You can also have multiple else statements on the same line:

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Comments starts with a #

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

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

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

39 / 40

39. Most recent major version of Python is Python 3

40 / 40

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

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.