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

3 / 40

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

4 / 40

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

5 / 40

5. A variable name can only contain alpha-numeric characters and
underscores

6 / 40

6. You can also use the remove() method to remove an element from the array

7 / 40

7.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

11. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

12 / 40

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

13 / 40

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

14 / 40

14.

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

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

15 / 40

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

16 / 40

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

17 / 40

17. Which of the following is the correct extension of the Python file?

18 / 40

18. Most recent major version of Python is Python 3

19 / 40

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

20 / 40

20.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

25 / 40

25.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

26 / 40

26. Python can connect to database systems.

27 / 40

27.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

28 / 40

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

29 / 40

29.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

30 / 40

30.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

31 / 40

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

32 / 40

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

33 / 40

33.

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

a. [ ]

b. { }

c. ( )

d. None of the above

34 / 40

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

35 / 40

35. Comments can be used to explain Python code.

36 / 40

36. print() function is often used to output variables.

37 / 40

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

38 / 40

38.

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

a. True

b. False

39 / 40

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

40 / 40

40. A variable name cannot start with a number

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.