• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Architect

  • Network Automation
    • Network Automation Courses
    • What is NetDevOps?
    • Workflow Orchestration
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Inventory Example
    • Python Network Automation
      • Nornir
      • Python Network Automation Course
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox
      • Infrahub
      • NautoBot
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

Python Data Types

Home » Python Tutorial for Beginners

Taken from my in depth Python Tutorial for Beginners the following page describes common data types.

Common Python Data Types

  • Strings
  • Dictionaries
  • Numbers
  • Booleans
  • Lists
  • Sets
  • Frozensets
  • Tuples
  • Ranges
  • Dictionaries
  • None

One way to classify data types is to determine if the data can be changed after creation or not, this is called mutable or immutable.

Mutable data types are:

  • Dictonaries
  • Lists
  • Sets

Immutable data types are:

  • Strings
  • Numbers
  • Tuples
  • Frozensets

Python Strings

Probably the most widely used data type. You will certainly use strings in nearly every Python programme you use.

A string in Python is a sequence of characters, letters numbers and other characters enclosed by quotes.

All the examples below are described in this video.

Python Strings Video in here

To create a string in Python we need to define it as below:

stringexample = "This is a string" 

One of the main elements of a string is indexing, as a string is a list of elements you can reference each element in a string by a number, however starting from the left the index of the first element (in our case T) would be 0.

So to access an element in my string above I would enter the command:

stringexample[0]

This would output the value T

See our in depth tutorial on Python Strings

Back Home

Frequently asked questions

What are Strings in Python?

A string in Python is a sequence of characters. It is a derived data type. Strings are immutable. This means that once defined, they cannot be changed. Many Python methods, such as replace() , join() , or split() can modify strings.

How many data types are there in Python?

Python has six standard data types. Numbers, Strings, Lists, Tuples, Sets & Dictionaries.

Sidebar

Quick Links

Python Data Types
- Strings
- Dictionaries

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Python VENV Tutorial
Python for Network Engineers

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
What is Ansible?
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2026 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms