[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

How to copy one list to another in python?

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

2 / 40

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

3 / 40

3. Is there any comments in  following codes

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

 

4 / 40

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

5 / 40

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

6 / 40

6. Variable names are case-sensitive

7 / 40

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

8 / 40

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

9 / 40

9. Most recent major version of Python is Python 3

10 / 40

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

11 / 40

11.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

12 / 40

12.

What is the value of the expression 100 / 25?

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

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

15.

Which is the correct operator for power(xy)?

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

16 / 40

16.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

17 / 40

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

18 / 40

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

19 / 40

19. You can also have an else without the elif

20 / 40

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

21 / 40

21. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

22 / 40

22. Python will give you an error if you skip the indentation

23 / 40

23. The list’s remove() method only removes the first occurrence of the specified value.

24 / 40

24.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

25 / 40

25.

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

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

26 / 40

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

27 / 40

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

28 / 40

28. Python is an interpreted programming language

29 / 40

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

30 / 40

30. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

31 / 40

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

32 / 40

32.

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

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

33 / 40

33. Comparison operators are not  used to compare two values

34 / 40

34.

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

35 / 40

35. The length of an array is always one more than the highest array index.

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

40 / 40

40.

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

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.