Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026
The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.
You can check if a variable is a string using the type() function, passing the variable as an argument, and then comparing the result to the str class:
name = "Roger"
type(name) == str #True
Or using isinstance(), passing 2 arguments: the variable, and the str class:
name = "Roger"
isinstance(name, str) #True