Filter
Exclude
Time range
-
Near
15 Aug 2024
๐ŸŽญ Welcome to 'CSI: Code Squad Investigation' ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ–ฅ๏ธ This image shows a Lambda function designed to find the square of a number. But there's a sneaky bug ๐Ÿžlurking within. Can you identify it? Best detective ๐Ÿ‘ฎwins bragging rights! #pythonpuzzle #datafrik #codechallenge
1
2
3
595
2 Aug 2024
๐Ÿ› Bug Hunt Challenge! ๐Ÿ” Can you spot the bug in this Python quiz code? It's a tricky one! ๐Ÿ’ก Hint: It's testing more than just your data type knowledge! ๐Ÿ† First to find it in the comments is our Data Hero of the day! #FunFriday #codechallenge #datafrik #pythonpuzzle
3
5
750
19 Jan 2024
๐Ÿšจ #PythonPuzzle Answer: Why `ZeroDivisionError` is the Culprit! ๐Ÿ Last week, we put our heads together to solve a Python code challenge. The function was simple: calculate a flow rate given a volume and time. But what happens when time equals zero? Letโ€™s break it down: โŒ Infinity? Nope. In Python, dividing by zero doesn't result in infinity. Unlike some other environments that may return an infinite value when dividing by zero, Python doesnโ€™t follow that convention. โŒ 0? Incorrect. Mathematically, division by zero is undefined. Itโ€™s not zero because you canโ€™t have a rate of change with no time elapsed - it's an indeterminate form. โŒ ValueError? Almost! Our function does check for negative time and would raise a `ValueError` if that were the case. But zero isn't negative, so this error wonโ€™t be raised. โœ… ZeroDivisionError! Bingo! ๐ŸŽฏ In Python, attempting to divide by zero triggers a `ZeroDivisionError`. Itโ€™s Python's way of saying, "Hold up, you canโ€™t do that!" The key takeaway? Always check your inputs and remember that Python has built-in exceptions for a reason. They prevent operations that can lead to undefined or unexpected behavior. Happy coding, and stay tuned for the next #PythonPuzzle! ๐Ÿงฉ Previous post: x.com/oskrgab/status/1745143โ€ฆ #engineering #programming #python #coding #learnpython #development
10 Jan 2024
Python Code Challenge ๐Ÿโœ”!! This time, let's define a simple flow rate calculation and print the result. What is the output of the following code? -------------------------------------------------------- def calculate_flow_rate(volume, time): # Flow Rate = Volume / Time if time < 0: raise ValueError("Time must be positive") return volume / time flow_rate = calculate_flow_rate(500, 0) print(f"Flow Rate: {flow_rate} barrels per day") ------------------------------------------------------- #python #engineering #polltime
2
52
๐Ÿ Unravel the Python mystery: I'm a loop without hoops, a reptilian named cycle. ๐Ÿ”„ Guess what I am in Python? #PythonPuzzle #GDSCMITWPU #GDSC #CodingChallenge #PythonLoop
3
54
๐Ÿงฉ Can you crack this easy #PythonPuzzle? word = "challenge" result = word[:4] word[-4:] What will โ€˜resultโ€™ contain?
9% challengenge
57% chalenge
9% chaenge
26% challlenge
23 votes โ€ข Final results
1
3
2,820
Rise and shine, #Python developers! โ˜€๏ธ๐Ÿ Let's kick off the day with a little brain teaser. ๐Ÿค” Can you guess the output of the code snippet below? ๐Ÿ’ป Don't forget to share your answers! ๐Ÿ‘‡ #LearnPython #PythonProgramming #PythonPuzzle
1
1
2
366
#python #pythonpuzzle What is the result from the following code? d1 = {"a": 1} d2 = {"a": 2} d3 = {**d1,**d2} print(d3["a"])
0% Output: 1
0% Output: 2
100% Runtime error
0% Syntax error
1 votes โ€ข Final results
1
2
2
6 Jul 2016
You wouldn't believe how hard that was!!!! #Pythonpuzzle #wontmakeagain
2