[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of below Python code?

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

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

2 / 40

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

3 / 40

3. python file can also run on command line

4 / 40

4. Comments starts with a #

5 / 40

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

6 / 40

6. Python can be treated in a procedural way, an object-oriented way or a functional way.

7 / 40

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

8 / 40

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

9 / 40

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

 

10 / 40

10.

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

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

15 / 40

15.

 Select the correct example of complex datatype in Python

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

16 / 40

16.

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

a. Define

b. DEF

c. def

d. Def

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

23 / 40

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

24 / 40

24.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

25 / 40

25. You can also have an else without the elif

26 / 40

26.

 ____________________ 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

27 / 40

27. Variables that are created outside of a function

28 / 40

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

29 / 40

29.

 What is output of: 35 == 35.0

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

30 / 40

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

31 / 40

31.

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

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

32 / 40

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

33 / 40

33.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

34 / 40

34.

What will be the output of above Python code?

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

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

35 / 40

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

36 / 40

36.

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.

37 / 40

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

38 / 40

38. Arithmetic operators are used with numeric values to perform common mathematical operations

39 / 40

39. python has two primitive loop commands:

  • while loops
  • for loops

40 / 40

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

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.