[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python is an interpreted programming language

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5.

 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.

6 / 40

6.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

7 / 40

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

8 / 40

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

 

9 / 40

9.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

10 / 40

10. Comments can be used to explain Python code.

11 / 40

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

12 / 40

12. Python can be install on both  Linux and  Windows

13 / 40

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

14 / 40

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

15 / 40

15. A variable name cannot start with a number

16 / 40

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

17 / 40

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

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.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

20 / 40

20. Most recent major version of Python is Python 3

21 / 40

21.

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

a. True

b. False

22 / 40

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

23 / 40

23.

 ____________________ 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

24 / 40

24. Variable names are case-sensitive

25 / 40

25.

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

a. [ ]

b. { }

c. ( )

d. None of the above

26 / 40

26.

What will be the output of above Python code?

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

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

27 / 40

27. Is there any comments in  following codes

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

 

28 / 40

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

29 / 40

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

30 / 40

30.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

31 / 40

31.

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

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

32 / 40

32. Variables that are created outside of a function

33 / 40

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

34 / 40

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

35 / 40

35.

Which function overloads the >> operator?

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. The for loop does not require an indexing variable to set beforehand

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.