02 - Data Types & Conversion

Опубликовано: 13 Май 2026
на канале: Aaron J Newman
867
10

We learn about different data types, including characters, strings, inegers, and floating point numbers. We also cover how to convert between types.

Summary:
Every value has a type
Use the built-in function `type` to find the type of a value
Types control what operations can be done on values
Strings can be added and multiplied
Strings have a length (but numbers don't)
Use the built-in function `len` to find the length of a string
Use an index to get a single character from a string
Use a slice to get a substring
Can mix integers and floats freely in operations
Must convert numbers to strings or vice versa when operating on them

From the course, NESC 3505 Neural Data Science, by Aaron J Newman, Dalhousie University, Halifax, NS, Canada.

All course videos are here: https://bit.ly/neural_data_science_vi...

Textbook is available here: http://neuraldatascience.io/intro.html

This lesson adapted from Software Carpentries: http://swcarpentry.github.io/python-n...