[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python relies on indentation?

3 / 40

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

4 / 40

4. Variables that are created outside of a function

5 / 40

5. Python has various versions available

6 / 40

6.

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

a. Define

b. DEF

c. def

d. Def

7 / 40

7. Python can be used on a server to create web applications?

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

11. With the for loop we can execute a set of statements

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

16 / 40

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

17 / 40

17. Who developed Python Programming Language?

18 / 40

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

19 / 40

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

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.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

22 / 40

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

23 / 40

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

24 / 40

24.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

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

a. True

b. False

30 / 40

30. python has two primitive loop commands:

  • while loops
  • for loops

31 / 40

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

32 / 40

32.

What is the data type of print(type(10))

33 / 40

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

34 / 40

34. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

35 / 40

35.

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

36 / 40

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

37 / 40

37.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

38 / 40

38. Python is a  high-level programming language.

39 / 40

39.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

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.