[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comparison operators are not  used to compare two values

2 / 40

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

3 / 40

3.

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

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

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

5 / 40

5. Arithmetic operators are used with numeric values to perform common mathematical operations

6 / 40

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

7 / 40

7.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

8 / 40

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

9 / 40

9.

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

a. Define

b. DEF

c. def

d. Def

10 / 40

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

11 / 40

11.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

12 / 40

12. Is there any comments in  following codes

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

 

13 / 40

13.

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

a. True

b. False

14 / 40

14.

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.

15 / 40

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

 

16 / 40

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

17 / 40

17. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

18 / 40

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

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

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

21 / 40

21.

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

22 / 40

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

23 / 40

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

24 / 40

24. We can combine strings and numbers by using the format() method

25 / 40

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

26 / 40

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

27 / 40

27.

 Select the correct example of complex datatype in Python

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

28 / 40

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

29 / 40

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

30 / 40

30.

 What is output of: 35 == 35.0

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

31 / 40

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

32 / 40

32.

Which is the correct operator for power(xy)?

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

33 / 40

33.

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

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

34 / 40

34.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

35 / 40

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

36 / 40

36.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

37 / 40

37.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

38 / 40

38. A variable name cannot start with a number

39 / 40

39. Python is a  high-level programming language.

40 / 40

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

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.