[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3. Python allows you to extract the values into variables.

4 / 40

4.

Which function overloads the >> operator?

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

5 / 40

5.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

6 / 40

6.

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

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

7 / 40

7.

What is the value of the expression 100 / 25?

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

8 / 40

8. Python is a  high-level programming language.

9 / 40

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

 

10 / 40

10.

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

11 / 40

11. Python can be install on both  Linux and  Windows

12 / 40

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

13 / 40

13.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

14 / 40

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

15 / 40

15.

 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.

16 / 40

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

17 / 40

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

18 / 40

18. Python can connect to database systems.

19 / 40

19. Python relies on indentation?

20 / 40

20. A variable name cannot start with a number

21 / 40

21. Comparison operators are not  used to compare two values

22 / 40

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

23 / 40

23.

 Select the correct example of complex datatype in Python

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

24 / 40

24. The length of an array is always one more than the highest array index.

25 / 40

25.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

26 / 40

26.

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.

27 / 40

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

28 / 40

28.

Which is the correct operator for power(xy)?

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

29 / 40

29. Pascal Case
Each word starts with a capital letter:

30 / 40

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

31 / 40

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

32 / 40

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

a. 5

b. 3

c. 6

d. 7

33 / 40

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

34 / 40

34.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

35 / 40

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

36 / 40

36. Python  was created by Guido van Rossum, and released in 1999.

37 / 40

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

38 / 40

38. Who developed Python Programming Language?

39 / 40

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

40 / 40

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

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.