Atharva Warke

  1. Type of 7: int

  2. Type of 5.123: float

  3. Result of int(8.99): 8

  4. Value of x where x = 3 + 2 * 2: 7

  5. Value of y where y = (3 + 2) * 2: 10

  6. Value of z where z = x + y: 17

  7. Result of 11 // 2: 5

  8. Value of x after x=4 and x=x/2: 2.0

  9. print(d[:3]) or print(d[0:3]) when d = “ABCDEFG”: ABC

  10. Substring “Python” and “Fun” from s = “PythonIsFun”: “Python”: s[:6] “Fun”: s[9:]

  11. print(e[::2]) where e = ‘clocrkr1e1c1t’: correct

  12. var.upper() where var = “You are learning python”: “YOU ARE LEARNING PYTHON”

  13. Operations on text t: Position of “slacker”: t.find(“slacker”) Replace “challenging” with “interesting”: t.replace(“challenging”, “interesting”)

  14. Scientist[-3] where Scientist = “Marie Curie”: “i”

  15. Output of print(“AB\nC\nDE”): AB C DE

  16. “hello class”.find(“class”): 6

  17. “data science”.find(“science”): 5

  18. Length of courses_tuple: 6

  19. Element at index 3: “Biology”

  20. Indexes 3, 4, and 5 of courses_tuple: (“Biology”, “English”, “History”)

  21. First two elements of courses_tuple: (“Mathematics”, “Physics”)

  22. Managing datasets_list: Create list: datasets_list = [] Add datasets: datasets_list.extend([“Housing Prices”, “Credit Card Fraud”, “Customer Segmentation”, “Stock Prices”, “Healthcare Claims”]) Add “Social Media Sentiment”: datasets_list.append(“Social Media Sentiment”) First dataset: datasets_list[0] Last dataset added: datasets_list[-1] Full list: print(datasets_list) Finance-related datasets: [“Credit Card Fraud”, “Stock Prices”] Replace “Stock Prices” with “Cryptocurrency Prices”: datasets_list[datasets_list.index(“Stock Prices”)] = “Cryptocurrency Prices” Remove “Healthcare Claims”: datasets_list.remove(“Healthcare Claims”)

  23. Keys of dictionary {“a”:1,“b”:2}: [“a”, “b”]

  24. Dict[“D”] for Dict={“A”:1,“B”:“2”,“C”:[3,3,3],“D”:(4,4,4),‘E’:5,‘F’:6}: (4, 4, 4)

  25. Textbooks dictionary management (textbooks_dict): Create dictionary: textbooks_dict = {} Add textbooks details and delete publicationYear as needed.

  26. Convert list [‘mystery’, ‘science fiction’, ‘fantasy’, ‘non-fiction’, ‘mystery’] to set: {“mystery”, “science fiction”, “fantasy”, “non-fiction”}

  27. Check if sum(A) == sum(B) where A = [1, 2, 2, 1] and B = set([1, 2, 2, 1]): False

  28. Union of programming_set1 and programming_set2: {“Python”, “Java”, “C++”, “Ruby”, “JavaScript”}

  29. Check if programming_set1 is a subset of programming_set2: False