[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. The format() method takes the passed arguments

3 / 40

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

4 / 40

4.

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

5 / 40

5.

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

6 / 40

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

7 / 40

7. Extension of all Python  Programme are .py

8 / 40

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

9 / 40

9. Comments can be used to explain Python code.

10 / 40

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

11 / 40

11. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

12 / 40

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

13 / 40

13. An array can hold many values under a single name

14 / 40

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

15 / 40

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

16 / 40

16.

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

17 / 40

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

18 / 40

18. You can have if statements inside if statements, this is called nested if statements.

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

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

21 / 40

21.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

22 / 40

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

23 / 40

23. Comments starts with a #

24 / 40

24.

What is the value of the expression 100 / 25?

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

25 / 40

25. Python can be treated in a procedural way, an object-oriented way or a functional way.

26 / 40

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

27 / 40

27.

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

28 / 40

28. A variable name cannot start with a number

29 / 40

29.

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

a. Define

b. DEF

c. def

d. Def

30 / 40

30.

 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.

31 / 40

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

32 / 40

32. Python is a  high-level programming language.

33 / 40

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

34 / 40

34. python has two primitive loop commands:

  • while loops
  • for loops

35 / 40

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

36 / 40

36. Variable names are case-sensitive

37 / 40

37. Python can connect to database systems.

38 / 40

38.

How to copy one list to another in python?

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

39 / 40

39.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

40 / 40

40.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

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.