[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

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. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

5 / 40

5. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

6 / 40

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

7 / 40

7.

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

8 / 40

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

9 / 40

9. An array is a special variable, which can hold more than one value at a time

10 / 40

10.

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

11 / 40

11. Variable names are case-sensitive

12 / 40

12. Python is an interpreted programming language

13 / 40

13.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

14 / 40

14. Python can connect to database systems.

15 / 40

15. Most recent major version of Python is Python 3

16 / 40

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

17 / 40

17. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

18 / 40

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

19 / 40

19.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

20 / 40

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

21 / 40

21.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

22 / 40

22. You can use the append() method to add an element to an array

23 / 40

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

24 / 40

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

25 / 40

25. You can also have an else without the elif

26 / 40

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

27 / 40

27. A variable name cannot start with a number

28 / 40

28. The format() method takes the passed arguments

29 / 40

29. Bitwise operators are used to compare (binary) numbers

30 / 40

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

31 / 40

31.

 ____________________ 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

32 / 40

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

33 / 40

33.

Which is the correct operator for power(xy)?

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

34 / 40

34.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

35 / 40

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

36 / 40

36.

Which function overloads the >> operator?

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

37 / 40

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

38 / 40

38. What will be the output of the following Python code?

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

39 / 40

39.

What is the value of the expression 100 / 25?

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

40 / 40

40.

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

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.