ChatGPT For Coders Prompts
ChatGPT For Coders Prompts
All the tasks has further prompts to improve time and space complexity with various logic
( Display the time complexity for each program showcase the execution efficiency)
Prompt 1:
Debug the program and provide corrected code
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Prompt 2:
Is there any other method which can be used in coding the same problem statement
Task 1: Paste /Type below code on ChatGPT interface and find the type of error
Code:
class MyClass:
def my_method(self):
print("Hello, Everyone!")
class MySubclass(MyClass):
def my_method(self):
print("Thankyou!")
obj =
obj.my_method()
Prompt 1:
Debug the program and provide corrected code
Prompt 2:
Is there any other method which can be used in coding the same problem statement
Task 2: Paste /Type below code on ChatGPT interface and find the type of error
Code:
numerator = 10
denominator = 0
result = numerator / denominator # This line will cause a ZeroDivisionError
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
print("Result:", result)
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited