Skip to content

Latest commit

 

History

History
70 lines (59 loc) · 2.26 KB

File metadata and controls

70 lines (59 loc) · 2.26 KB

Certainly, here are the questions converted into multiple-choice questions with the correct answers checked:

  1. What is a magic square?

    • A) A square grid of letters
    • B) A square grid of numbers where the sum of the rows, columns, & diagonals are equal ✓
    • C) A special kind of card trick
    • D) A term used in cryptography
  2. In a 3x3 magic square, what is the magic constant?

    • A) 3
    • B) 6
    • C) 9
    • D) 15 ✓
  3. Which of the following is NOT a property of a magic square?

    • A) The sum of each row is equal
    • B) The sum of each column is equal
    • C) The sum of each diagonal is equal
    • D) The sum of each individual element is equal ✓
  4. What will be the output of the following code? ![[Pasted image 20231029093653.jpg]]

    • A) A magic square of size 2.
    • B) A magic square of size n. ✓
    • C) A magic square of an even size.
    • D) A magic square of an odd size.
  5. What will be the output of the following code? ![[Pasted image 20231029093701.jpg]]

    • A) Sorted List(L) containing random elements between 0-10 in descending order. ✓
    • B) Sorted List containing random elements between 0-10 in ascending order.
    • C) Sorted List containing elements between 0-10.
    • D) Sorted List containing elements between 0-9 in ascending order.
  6. Which code will generate all prime numbers between 0-100?

  • ![[Pasted image 20231029093716.jpg]] -![[Pasted image 20231029093747.jpg]] ✓ -![[Pasted image 20231029093752.jpg]] -![[Pasted image 20231029093754.jpg]]
  1. In the birthday paradox, as the number of people in a group increases, what happens to the probability that two people share a birthday?

    • A) It increases ✓
    • B) It decreases
    • C) It stays the same
    • D) It becomes impossible
  2. Which module is used to generate random numbers in Python?

    • A) math
    • B) random ✓
    • C) stats
    • D) numpy
  3. Which function is used to shuffle a list in Python?

    • A) random.shuffle() ✓
    • B) shuffle()
    • C) list.shuffle()
    • D) random_list()
  4. What is the output of the following code?

    import random
    nums = [1, 2, 3, 4, 5]
    random.shuffle(nums)
    print(nums)
  • A) [1, 2, 3, 4, 5]
  • B) [5, 4, 3, 2, 1]
  • C) A random ordering of the numbers 1 through 5 ✓
  • D) An error