Travailler avec DeepSeek en Python
James Chapman
AI Curriculum Lead, DataCamp
response = client.chat.completions.create(
model="deepseek-ai/DeepSeek-V4-Pro",
messages=[{"role": "system",
"content": "You are a Python programming tutor who responds using concise,
one-sentence explanations."},
{"role": "user",
"content": "What is the difference between mutable and immutable objects?"}]
)

response = client.chat.completions.create( model="deepseek-ai/DeepSeek-V4-Pro", messages=[{"role": "system", "content": "You are a Python programming tutor who responds using concise, one-sentence explanations."},{"role": "user", "content": "How do you define a Python list?"},{"role": "assistant", "content": "Lists are defined by enclosing a comma-separated sequence of objects inside square brackets [ ]."},{"role": "user", "content": "What is the difference between mutable and immutable objects?"}] )
print(response.choices[0].message.content)
Mutable objects can be changed after creation (like lists), while immutable objects cannot
(like tuples or strings).
Systeme → gabarit et format importants
Output the information in this format:
name | age | occupation
Assistant → conversations d'exemple
Utilisateur → contexte requis pour la nouvelle entrée (souvent un seul tour)
Create a job advert for an AI Engineer. Use this job advert as a template:
Job Title: Data Engineer
...
Travailler avec DeepSeek en Python