[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of above Python code?

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

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

2 / 40

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

3 / 40

3.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

4 / 40

4. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

5 / 40

5.

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

a. True

b. False

6 / 40

6.

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

7 / 40

7. python file can also run on command line

8 / 40

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

9 / 40

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

10 / 40

10. An array can hold many values under a single name

11 / 40

11.

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

a. [ ]

b. { }

c. ( )

d. None of the above

12 / 40

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

13 / 40

13.

What is the value of the expression 100 / 25?

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

14 / 40

14.

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

a. 2

b. 3

c. 5

d. Multiple times

15 / 40

15. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

16 / 40

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

17 / 40

17.

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

18 / 40

18.

How to copy one list to another in python?

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

19 / 40

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

20 / 40

20.

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

21 / 40

21. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

22 / 40

22. Extension of all Python  Programme are .py

23 / 40

23. Python is a  high-level programming language.

24 / 40

24. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

25 / 40

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

26 / 40

26.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

27 / 40

27.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

28 / 40

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

29 / 40

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

30 / 40

30.

Which function overloads the >> operator?

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

35 / 40

35.

 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.

36 / 40

36. You can also have an else without the elif

37 / 40

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

38 / 40

38. Most recent major version of Python is Python 3

39 / 40

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

40 / 40

40.

 Select the correct example of complex datatype in Python

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

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.