Free practice topic
Python strings for prompts and text
Learn Python string basics for GenAI prompts: strip, split, f-strings, and clean user text before sending it to a model.
What you will learn
- +Create and combine strings
- +Clean prompts with strip and lower
- +Format metrics and messages
Starter idea: Clean a messy prompt string, then print a formatted metric line.
Tiny example
Make a string and print its length.
name = "RAG"
print(name)
print(len(name))