[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. python has two primitive loop commands:

  • while loops
  • for loops

2 / 40

2. Extension of all Python  Programme are .py

3 / 40

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

4 / 40

4.

 What is output of: 35 == 35.0

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

5 / 40

5. Python can connect to database systems.

6 / 40

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

7 / 40

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

8 / 40

8. Python relies on indentation?

9 / 40

9. Who developed Python Programming Language?

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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

14 / 40

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

15 / 40

15.

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

16 / 40

16. Variables that are created outside of a function

17 / 40

17.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

18 / 40

18.

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

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

19 / 40

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

20 / 40

20.

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

21 / 40

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

22 / 40

22.

Which is the correct operator for power(xy)?

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

23 / 40

23. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

28 / 40

28. Comments can be used to make the code more readable.

29 / 40

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

30 / 40

30. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

31 / 40

31.

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.

32 / 40

32. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. The format() method takes unlimited number of arguments

38 / 40

38.

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

a. [ ]

b. { }

c. ( )

d. None of the above

39 / 40

39.

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

40 / 40

40. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

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.