[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

2 / 40

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

3 / 40

3.

 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.

4 / 40

4. A variable name must start with a letter or the underscore character

5 / 40

5. Python is a  high-level programming language.

6 / 40

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

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

8. Variable names are case-sensitive

9 / 40

9. Who developed Python Programming Language?

10 / 40

10. Python can be used to handle big data and perform complex mathematics.

11 / 40

11.

 What is output of: 35 == 35.0

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

16 / 40

16.

 Select the correct example of complex datatype in Python

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

17 / 40

17.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

18 / 40

18.

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

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

19 / 40

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

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

21.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

22 / 40

22. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

23 / 40

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

24 / 40

24. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

25 / 40

25. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

26 / 40

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

27 / 40

27.

 ____________________ 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

28 / 40

28.

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

29 / 40

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

30 / 40

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

31 / 40

31.

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

a. True

b. False

32 / 40

32. + operator is used  to get output of multiple variables

33 / 40

33.

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

34 / 40

34. The list’s remove() method only removes the first occurrence of the specified value.

35 / 40

35. Comments starts with a #

36 / 40

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

37 / 40

37.

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

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

38 / 40

38.

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.

39 / 40

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

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.