[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. You can have if statements inside if statements, this is called nested if statements.

3 / 40

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

4 / 40

4.

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

5 / 40

5.

 ____________________ 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

6 / 40

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

7 / 40

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

8 / 40

8.

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

a. Define

b. DEF

c. def

d. Def

9 / 40

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

10 / 40

10. Comments starts with a #

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

14.

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

15 / 40

15. Python can connect to database systems.

16 / 40

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

17 / 40

17. Most recent major version of Python is Python 3

18 / 40

18.

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

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

19 / 40

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

20 / 40

20.

What is the data type of print(type(0xFF))

21 / 40

21.

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

22 / 40

22. Is there any comments in  following codes

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

 

23 / 40

23. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

24 / 40

24. python has two primitive loop commands:

  • while loops
  • for loops

25 / 40

25. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

26 / 40

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

 

27 / 40

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

28 / 40

28. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

29 / 40

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

30 / 40

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

31 / 40

31. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

32 / 40

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

33 / 40

33. During Installation Make sure to select both the checkboxes at the bottom .

34 / 40

34. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

35 / 40

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

36 / 40

36. The length of an array is always one more than the highest array index.

37 / 40

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

38 / 40

38. Who developed Python Programming Language?

39 / 40

39. Variables that are created outside of a function

40 / 40

40. Python has various versions available

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.