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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

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

8 / 40

8.

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

a. True

b. False

9 / 40

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

10 / 40

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

11 / 40

11. Python relies on indentation?

12 / 40

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

13 / 40

13. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

14 / 40

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

15 / 40

15.

Which is the correct operator for power(xy)?

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

16 / 40

16.

 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.

17 / 40

17.

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

18 / 40

18. python file can also run on command line

19 / 40

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

20 / 40

20. The format() method takes the passed arguments

21 / 40

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

22 / 40

22. The len() method to return the length of an array

23 / 40

23.

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

24 / 40

24.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

25 / 40

25. An array is a special variable, which can hold more than one value at a time

26 / 40

26.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

27 / 40

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

28 / 40

28. Variable names are case-sensitive

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. Most recent major version of Python is Python 3

33 / 40

33. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

34 / 40

34.

 Select the correct example of complex datatype in Python

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

39 / 40

39.

What is the value of the expression 100 / 25?

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

40 / 40

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

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.