[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 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.

3 / 40

3.

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

4 / 40

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

5 / 40

5. You can also use the remove() method to remove an element from the array

6 / 40

6.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

7 / 40

7. Comparison operators are not  used to compare two values

8 / 40

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

a. 5

b. 3

c. 6

d. 7

9 / 40

9.

How to copy one list to another in python?

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

10 / 40

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

11 / 40

11. Comments can be used to explain Python code.

12 / 40

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

13 / 40

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

14 / 40

14.

Which is the correct operator for power(xy)?

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

15 / 40

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

16 / 40

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

17 / 40

17. Python is a  high-level programming language.

18 / 40

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

19 / 40

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

20 / 40

20.

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

a. 2

b. 3

c. 5

d. Multiple times

21 / 40

21.

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

22 / 40

22.

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.

23 / 40

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

24 / 40

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

25 / 40

25.

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

26 / 40

26. Strings in python are surrounded by either single quotation marks, or double quotation marks

27 / 40

27. print() function is often used to output variables.

28 / 40

28.

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

29 / 40

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

30 / 40

30. Python is an interpreted programming language

31 / 40

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

32 / 40

32.

 What is output of: 35 == 35.0

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. With the break statement we can stop the loop even if the while condition is true

40 / 40

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

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.