[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

5 / 40

5. Variables that are created outside of a function

6 / 40

6. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

7 / 40

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

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

10 / 40

10. Who developed Python Programming Language?

11 / 40

11. Most recent major version of Python is Python 3

12 / 40

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

13 / 40

13. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

14 / 40

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

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. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

17 / 40

17. What is the output of the given below program?

if 3 + 4 == 7:    print("Hi")else:    print("Know Program")print("Hello")

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

18 / 40

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

19 / 40

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

20 / 40

20.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

21 / 40

21. Indentation refers to the spaces at the beginning of a code line.

22 / 40

22.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

23 / 40

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

24 / 40

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

25 / 40

25. Python can be install on both  Linux and  Windows

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

31 / 40

31. Snake Case
Each word is separated by an underscore character:

32 / 40

32.

 ____________________ 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

33 / 40

33. Is there any comments in  following codes

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

 

34 / 40

34. python has two primitive loop commands:

  • while loops
  • for loops

35 / 40

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

36 / 40

36. A variable name cannot start with a number

37 / 40

37.

How to copy one list to another in python?

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

38 / 40

38.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

39 / 40

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

40 / 40

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

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.