Python provides a number of basic data types that can be used to store different kinds of values in a variable. Let’s explore the first of these data types: python string.
The string data type is used to store information that is a sequence of characters including alphabets, symbols, and numbers. There are multiple ways to create a string data type in Python using a single-quote
‘, a regular quotation mark (double quotes)
“, or a set of three single quotes (triple quotes)
‘’’. Using a set of three single quotes is a specific way of creating a string data type that can span multiple lines and have whitespace characters preserved inside it. Let’s create some string data types in our notebook following along with the code in the image below:
As seen above, a string can be created using single, double, or triple quotes. Even though we purposely entered some whitespace characters in the
voicemail_message variable, it is preserved when we see the value stored in that variable. The preferred way of creating string variables is by using single quotes unless whitespace needs to be preserved.
Kick-Start Your Data Career
We offer a wide variety of programs and courses built on adaptive curriculum and led by leading industry experts.
- Work on projects in a collaborative setting
- Take advantage of our flexible plans and scholarships
- Get access to VIP events and workshops
The Python certificate course provides individuals with fundamental Python programming skills to effectively work with data.
Taught by data professionals working in the industry, the part-time Data Science course is built on a project-based learning model, which allows students to use data analysis, modeling, Python programming, and more to solve real analytical problems.
The Data Science bootcamp is an intensive course designed to launch students' careers in data.
The part-time Data Analytics course was designed to introduce students to the fundamentals of data analysis.