[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

2 / 40

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

3 / 40

3.

How to copy one list to another in python?

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

4 / 40

4.

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

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

5 / 40

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

6 / 40

6. The len() method to return the length of an array

7 / 40

7.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

8 / 40

8. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

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

11 / 40

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

12 / 40

12.

What will be the output of above Python code?

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

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

13 / 40

13.

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

a. 2

b. 3

c. 5

d. Multiple times

14 / 40

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

15 / 40

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

16 / 40

16.

 ____________________ 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

17 / 40

17.

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.

18 / 40

18. Python is a  high-level programming language.

19 / 40

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

20 / 40

20. Comments can be used to explain Python code.

21 / 40

21. Comparison operators are not  used to compare two values

22 / 40

22. Who developed Python Programming Language?

23 / 40

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

24 / 40

24. Python relies on indentation?

25 / 40

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

26 / 40

26. Comments starts with a #

27 / 40

27. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

28 / 40

28. The format() method takes unlimited number of arguments

29 / 40

29.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

30 / 40

30.

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

a. Define

b. DEF

c. def

d. Def

31 / 40

31. Python is an interpreted programming language

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. Is there any comments in  following codes

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

 

37 / 40

37.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

38 / 40

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

39 / 40

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

40 / 40

40.

 What is output of: 35 == 35.0

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

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.