[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Comparison operators are not  used to compare two values

2 / 40

2.

Which function overloads the >> operator?

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

3 / 40

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

a. 5

b. 3

c. 6

d. 7

4 / 40

4. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

5 / 40

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

6 / 40

6.

What will be the output of above Python code?

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

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

7 / 40

7.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

8 / 40

8. Python relies on indentation?

9 / 40

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

10 / 40

10. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

11 / 40

11.

 ____________________ 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

12 / 40

12. Python is a  high-level programming language.

13 / 40

13.

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

14 / 40

14. Who developed Python Programming Language?

15 / 40

15. Variable names are case-sensitive

16 / 40

16. A variable name cannot start with a number

17 / 40

17. Python is an interpreted programming language

18 / 40

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

19 / 40

19.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

20 / 40

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

21 / 40

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

22 / 40

22.

What is the value of the expression 100 / 25?

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

23 / 40

23.

Which is the correct operator for power(xy)?

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

24 / 40

24. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

25 / 40

25. You can also have an else without the elif

26 / 40

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

27 / 40

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

28 / 40

28.

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

a. [ ]

b. { }

c. ( )

d. None of the above

29 / 40

29.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

30 / 40

30.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

31 / 40

31. Python has various versions available

32 / 40

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

33 / 40

33.

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

34 / 40

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

35 / 40

35. Pascal Case
Each word starts with a capital letter:

36 / 40

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

37 / 40

37. Comments starts with a #

38 / 40

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

39 / 40

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

40 / 40

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

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.