Professional Documents
Culture Documents
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Agenda
In this session, we will discuss:
● Introduction to AI and ChatGPT
● ChatGPT v/s GitHub Copilot
● Using ChatGPT with and without Programming Expertise
● ChatGPT to build programs
● Code Interpreter(Beta) in ChatGPT
● Interpreting Code using ChatGPT
● Debugging with ChatGPT
● Exception Handling using ChatGPT
● Testing using ChatGPT
● Extra uses of ChatGPT
● Coding Limitations of ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Introduction to ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
What is Artificial Intelligence?
● Artificial Intelligence is the simulation of human intelligence in machines designed to
think and act like people.
● AI involves the development of algorithms and computer programs that can perform
tasks that typically require human intelligence, such as understanding natural
language, recognizing objects and images, making decisions, and solving problems.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
What is ChatGPT?
● ChatGPT is an AI-powered language model developed by OpenAI.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
ChatGPT v/s GitHub Copilot
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
ChatGPT v/s GitHub Copilot
ChatGPT GitHub Copilot
For those just starting out or learning Professional developers are advised
to code, ChatGPT is a suggested to use the premium GitHub Copilot.
general solution because it is free and
can help generate code with
explanations.
ChatGPT can help develop code and Machine learning is used by GitHub
follow up on it, but if the conversation Copilot to continuously learn from
is lost, it cannot continue without code and behaviour, enhancing
special instruction. suggestions over time.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Using ChatGPT with and without
Programming Expertise
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Using ChatGPT with and without Programming Expertise
With Programming Expertise:
● We can incorporate ChatGPT with our own programmes or services by using the
OpenAI API. Because of this, we may create intelligent chatbots, automated customer
service systems, and other language-based solutions that are customised for your
requirements.
● With programming knowledge, the underlying ChatGPT model can be improved to be
more domain-specific on particular datasets.
● ChatGPT can be used to help with producing code snippets, creating documentation,
or come up with programming problem-solving ideas.
● We may influence ChatGPT's behaviour and make sure it complies with our
requirements by being aware of the underlying architecture and APIs.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Using ChatGPT with and without Programming Expertise
Without Programming Expertise:
● We can communicate with ChatGPT normally with day to day words which we use. We
can converse informally, ask questions, get writing tips, obtain creative writing
recommendations, and discuss ideas.
● Although ChatGPT is a strong language model that can provide responses that
resemble those as of people, it might not be able to comprehend sophisticated
programming-related questions or offer in-depth programming assistance.
● We won't be able to expand ChatGPT's functionality or adapt it to particular
programming requirements without programming knowledge.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
ChatGPT to build programs
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
ChatGPT to build programs
Task 1: Program to build BMI Calculator
Prompt:
Write a program in Python to calculate BMI
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Code Interpreter in ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Code Interpreter (Beta) in ChatGPT
● The most recent addition to OpenAI ChatGPT (particularly with the GPT-4 model) is
the Code Interpreter, which enables us to execute Python code in a real-time
working environment.
● It essentially functions as a sandboxed Python environment where any Python code
can be run to do any purpose.
● It may seem like a function designed for programmers, but it may assist regular users
with a variety of tasks as well.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Interpreting Code using ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Interpreting Code using ChatGPT
Comparison between ChatGPT 3.5 and 4.0
ChatGPT 3.5 has no code interpreter ChatGPT 4.0 has code interpreter
option. (beta) feature.
ChatGPT 3.5 does not allow file upload ChatGPT 4.0 lets user upload code file
or output download. and download the output.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Interpreting Code using ChatGPT 3.5
Task 1 : Program to add two numbers
Prompt:
Write a program to add two numbers
Task 2 : Modify the existing code file adding extra code features
Prompt:
Add other arithmetic operations for the existing code
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Interpreting Code using ChatGPT 4.0
Open → Settings → Beta → Code Interpreter → Switch on the toggle
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Debugging with ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Debugging with ChatGPT
Task 1: Paste/Type below code on ChatGPT interface and find the error
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
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Debugging with ChatGPT
Task 1: Paste /Type below code on ChatGPT interface and find the error
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
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Exception Handling using ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Exception Handling using ChatGPT
Task 1: Paste /Type below code on ChatGPT interface and find the type of error
Prompt 1:
Add an exception for the above code
Prompt 2:
Add an exception to handle decimal index value
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Exception Handling using ChatGPT
Task 2: Paste /Type below code on ChatGPT interface and find the type of error
Prompt 1:
Add an exception for the above code
Prompt 2:
Add an exception with another logic
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Testing using ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Testing using ChatGPT
Prompt 1:
Write unit test for above code
Prompt 2:
Suggest code improvement ideas for the above code
Prompt 3:
Implement any one of the idea and provide the code
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Extra uses of ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Extra uses of ChatGPT
Prompt 1:
Provide code documentation for the above code
Prompt 2:
Suggest code improvement ideas for the above code
Prompt 3:
Implement any one of the idea and provide the code
Prompt 4:
Create a dummy spreadsheet with four columns (Name, Age, Income, City) and fill
it with 10 rows of dummy data. Format the resulting spreadsheet data as a table.
Check in GPT 3.5 and 4
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Coding Limitations of ChatGPT
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Coding Limitations of ChatGPT
ChatGPT has some limitations due to its underlying architecture and training data.
Here are some of the key limitations of ChatGPT 3.5:
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited
Summary
A quick recap:
● ChatGPT is a type of language model that uses deep learning to generate human-like responses to
text-based prompts.
● ChatGPT and GitHub copilot had many differences with respect to premium access, response to the
prompts, trained data set etc.
● Programmers and non programmers can easily work with ChatGPT, but its an added advantage when a
end user is well knowledged on programming.
● Many prompts and examples on codes were demonstrated on aspect of how to buid programs, debug,
handle exceptions, code testing.
● Demonstrated extra uses of ChatGPT like code documentation and dummy data creation.
● ChatGPT has some limitations due to its underlying architecture and training data listing few like
verbosity repetition, sensitive content bias etc.
Proprietary content. ©Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited