[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which is the correct operator for power(xy)?

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

2 / 40

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

3 / 40

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

4 / 40

4. Variables that are created outside of a function

5 / 40

5. Snake Case
Each word is separated by an underscore character:

6 / 40

6. Python is a  high-level programming language.

7 / 40

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

8 / 40

8.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

9 / 40

9. Python relies on indentation?

10 / 40

10.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. Pip is  not a powerful package management system for Python software packages

17 / 40

17. Who developed Python Programming Language?

18 / 40

18.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

19 / 40

19. The else keyword catches anything which isn’t caught by the preceding conditions.

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23.

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

a. [ ]

b. { }

c. ( )

d. None of the above

24 / 40

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

25 / 40

25.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

26 / 40

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

27 / 40

27.

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

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

28 / 40

28. Python has various versions available

29 / 40

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

30 / 40

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

31 / 40

31.

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

32 / 40

32.

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

33 / 40

33.

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

34 / 40

34. Is there any comments in  following codes

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

 

35 / 40

35.

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

36 / 40

36. Python is an interpreted programming language

37 / 40

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

38 / 40

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

39 / 40

39. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

40 / 40

40.

 ____________________ 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

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.