[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. You can also use the remove() method to remove an element from the array

2 / 40

2. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

3 / 40

3. Python can connect to database systems.

4 / 40

4. 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”

5 / 40

5. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

6 / 40

6.

Which is the correct operator for power(xy)?

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

7 / 40

7.

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

8 / 40

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

9 / 40

9.

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

a. Define

b. DEF

c. def

d. Def

10 / 40

10.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

11 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

12 / 40

12. The format() method takes the passed arguments

13 / 40

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

14 / 40

14. Python is an interpreted programming language

15 / 40

15. A variable name cannot start with a number

16 / 40

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

17 / 40

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

18 / 40

18.

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

19 / 40

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

a. 5

b. 3

c. 6

d. 7

20 / 40

20. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

21 / 40

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

22 / 40

22. Python is a  high-level programming language.

23 / 40

23. You can also have an else without the elif

24 / 40

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

25 / 40

25.

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

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

26 / 40

26. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

27 / 40

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

28 / 40

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

29 / 40

29.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

30 / 40

30.

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

31 / 40

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

32 / 40

32.

What is the value of the expression 100 / 25?

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

33 / 40

33. Variables that are created outside of a function

34 / 40

34.

Which function overloads the >> operator?

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

35 / 40

35.

How to copy one list to another in python?

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

36 / 40

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

37 / 40

37.

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

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

38 / 40

38. python file can also run on command line

39 / 40

39. With the break statement we can stop the loop before it has looped through all the items

40 / 40

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

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.