[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comments starts with a #

2 / 40

2. Variables that are created outside of a function

3 / 40

3. To insert characters that are illegal in a string, use an escape character

4 / 40

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

5 / 40

5.

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

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

6 / 40

6.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

7 / 40

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

8 / 40

8. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

9 / 40

9.

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

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

10 / 40

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

a. 5

b. 3

c. 6

d. 7

11 / 40

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

12 / 40

12.

Which is the correct operator for power(xy)?

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

13 / 40

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

14 / 40

14. Extension of all Python  Programme are .py

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

18. Python can be used to handle big data and perform complex mathematics.

19 / 40

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

20 / 40

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

21 / 40

21.

 What is output of: 35 == 35.0

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

22 / 40

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

23 / 40

23. Variable names are case-sensitive

24 / 40

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

25 / 40

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

26 / 40

26.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

27 / 40

27.

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

28 / 40

28.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

29 / 40

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

30 / 40

30.

 Select the correct example of complex datatype in Python

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

31 / 40

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

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

35. A variable name cannot start with a number

36 / 40

36. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

37 / 40

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

38 / 40

38.

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

39 / 40

39. The list’s remove() method only removes the first occurrence of the specified value.

40 / 40

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

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.