Skip to main content

๐Ÿ”ข Lesson 2.2: Data Types โ€” Numbers, Strings, Booleans

Every piece of data has a type. Understanding types is the key to understanding why code works โ€” or why it breaks.

๐ŸŽฏ Learning Objectives

By the end of this lesson, you will be able to:

  • Identify the three fundamental data types: numbers, strings, and booleans
  • Explain how number types differ across Python, JavaScript, and C#
  • Perform common string operations: concatenation, length, and indexing
  • Use string interpolation (f"", `${}`, $"") to build dynamic text
  • Use booleans for true/false decisions

Estimated Time: 45 minutes

Project: A "Character Stats Card" that formats and displays mixed data types

๐Ÿ“‘ In This Lesson

Why Types Matter

In the previous lesson, you stored data in variables. But not all data is the same โ€” a number like 42 behaves very differently from a string like "42". The type of a piece of data determines what you can do with it.

graph TD A["Data Types"] --> B["Numbers
42, 3.14, -7"] A --> C["Strings
'hello', 'Alex'"] A --> D["Booleans
true / false"] B --> E["Math operations
+, -, *, /"] C --> F["Text operations
join, slice, search"] D --> G["Logic & decisions
if / else"] style A fill:#3b82f6,stroke:#1e40af,color:#fff,stroke-width:2px style B fill:#f59e0b,stroke:#d97706,color:#fff,stroke-width:2px style C fill:#10b981,stroke:#059669,color:#fff,stroke-width:2px style D fill:#8b5cf6,stroke:#6d28d9,color:#fff,stroke-width:2px

Consider this puzzle: what does 5 + 3 produce? If both are numbers, you get 8. But if they're strings, "5" + "3" gives you "53" โ€” the strings are glued together, not added mathematically. Types determine the rules.

๐Ÿ“– Key Term

Data Type: A classification that tells the language what kind of value a variable holds and what operations are valid for it. The three most fundamental types in nearly every language are numbers, strings (text), and booleans (true/false).

Numbers

All three languages can do math, but they handle numbers quite differently under the hood.

Integers and Decimals

# Python has two number types: int and float
whole = 42          # int (integer โ€” no decimal point)
decimal = 3.14      # float (floating-point โ€” has a decimal)
negative = -7       # int (integers can be negative)

print(type(whole))    # <class 'int'>
print(type(decimal))  # <class 'float'>

# Python integers can be HUGE โ€” no size limit
big = 99999999999999999999999999999
print(big)  # works perfectly!
// JavaScript has ONE number type: number
let whole = 42;         // number
let decimal = 3.14;     // number (same type!)
let negative = -7;      // number

console.log(typeof whole);    // "number"
console.log(typeof decimal);  // "number"
// Both are just "number" โ€” JS doesn't distinguish!

// For very large integers, JS has BigInt
let big = 99999999999999999999999999999n;  // note the 'n'
console.log(typeof big);  // "bigint"
// C# has MANY number types โ€” here are the most common
int whole = 42;           // 32-bit integer
double decimal2 = 3.14;  // 64-bit floating-point (most common)
float precise = 3.14f;   // 32-bit floating-point (note the 'f')
decimal money = 19.99m;  // 128-bit (precise โ€” great for money)
long bigNum = 9999999999L;  // 64-bit integer

Console.WriteLine(whole.GetType());    // System.Int32
Console.WriteLine(decimal2.GetType()); // System.Double

Number Types Compared

Concept ๐Ÿ Python โšก JavaScript ๐Ÿ”ท C#
Whole numbers int number int, long
Decimals float number (same!) double, float, decimal
Integer size limit Unlimited ยฑ2โตยณ (then use BigInt) int: ยฑ2 billion
Best for money Decimal module Use cents (integers) decimal

Basic Math Operations

a = 17
b = 5

print(a + b)   # 22   Addition
print(a - b)   # 12   Subtraction
print(a * b)   # 85   Multiplication
print(a / b)   # 3.4  Division (always returns float!)
print(a // b)  # 3    Floor division (rounds down)
print(a % b)   # 2    Modulo (remainder)
print(a ** b)  # 1419857  Exponent (17 to the 5th)
let a = 17;
let b = 5;

console.log(a + b);   // 22   Addition
console.log(a - b);   // 12   Subtraction
console.log(a * b);   // 85   Multiplication
console.log(a / b);   // 3.4  Division
console.log(Math.floor(a / b));  // 3  Floor division
console.log(a % b);   // 2    Modulo (remainder)
console.log(a ** b);  // 1419857  Exponent
int a = 17;
int b = 5;

Console.WriteLine(a + b);   // 22   Addition
Console.WriteLine(a - b);   // 12   Subtraction
Console.WriteLine(a * b);   // 85   Multiplication
Console.WriteLine(a / b);   // 3    Integer division! (truncates)
Console.WriteLine(17.0 / 5);  // 3.4  Use a double for decimal result
Console.WriteLine(a % b);   // 2    Modulo (remainder)
Console.WriteLine(Math.Pow(a, b));  // 1419857  Exponent

โš ๏ธ Watch Out: Integer Division in C#

In C#, dividing two int values gives an int result โ€” the decimal part is thrown away, not rounded. 17 / 5 gives 3, not 3.4. To get a decimal result, at least one operand must be a double: 17.0 / 5 gives 3.4.

Python's / always gives a float. JavaScript's / always gives a decimal. C# is the surprise here.

๐ŸŽ“ Instructor Note: Delivery Guidance

The C# integer division gotcha is one of the most important things to demo live. Write Console.WriteLine(7 / 2); and ask students to predict the output. Most will say 3.5. When they see 3, that's the teachable moment. Also emphasize that Python's / always returning a float (even 10 / 2 gives 5.0) is different from many other languages.

Strings

A string is a sequence of characters โ€” text data. It can hold letters, numbers, symbols, spaces, even emoji. Strings are always enclosed in quotes.

Creating Strings

# Python: single or double quotes โ€” both work
greeting = "Hello, world!"
name = 'Alex'

# Triple quotes for multi-line strings
poem = """Roses are red,
Violets are blue,
Python is great,
And so are you."""

# Strings with special characters
path = "C:\\Users\\Alex"    # backslash needs escaping
tab = "Column1\tColumn2"   # \t = tab
newline = "Line1\nLine2"   # \n = new line
// JavaScript: single, double, or backtick quotes
let greeting = "Hello, world!";
let name = 'Alex';

// Backticks for multi-line and template literals
let poem = `Roses are red,
Violets are blue,
JavaScript is great,
And so are you.`;

// Special characters work the same way
let path = "C:\\Users\\Alex";
let tab = "Column1\tColumn2";
let newline = "Line1\nLine2";
// C#: double quotes only (single quotes are for single chars)
string greeting = "Hello, world!";
string name = "Alex";

// Verbatim strings with @ (no escaping needed)
string path = @"C:\Users\Alex";

// Raw string literals (C# 11+) for multi-line
string poem = """
    Roses are red,
    Violets are blue,
    C# is great,
    And so are you.
    """;

// char type: a single character (uses single quotes)
char grade = 'A';
char initial = 'R';

Common String Operations

name = "Alex Johnson"

# Length
print(len(name))       # 12

# Indexing (0-based โ€” first character is index 0)
print(name[0])         # A
print(name[5])         # J
print(name[-1])        # n (last character)

# Slicing
print(name[0:4])       # Alex (characters 0,1,2,3)
print(name[5:])        # Johnson (from index 5 to end)

# Case changes
print(name.upper())    # ALEX JOHNSON
print(name.lower())    # alex johnson

# Searching
print("John" in name)         # True
print(name.find("John"))      # 5 (index where it starts)

# Concatenation (joining strings)
first = "Alex"
last = "Johnson"
full = first + " " + last     # "Alex Johnson"
let name = "Alex Johnson";

// Length (it's a property, not a function)
console.log(name.length);       // 12

// Indexing (0-based)
console.log(name[0]);           // A
console.log(name[5]);           // J
console.log(name[name.length - 1]); // n (last character)

// Slicing
console.log(name.slice(0, 4));  // Alex
console.log(name.slice(5));     // Johnson

// Case changes
console.log(name.toUpperCase()); // ALEX JOHNSON
console.log(name.toLowerCase()); // alex johnson

// Searching
console.log(name.includes("John"));  // true
console.log(name.indexOf("John"));   // 5

// Concatenation
let first = "Alex";
let last = "Johnson";
let full = first + " " + last;      // "Alex Johnson"
string name = "Alex Johnson";

// Length (property)
Console.WriteLine(name.Length);       // 12

// Indexing (0-based)
Console.WriteLine(name[0]);          // A
Console.WriteLine(name[5]);          // J
Console.WriteLine(name[^1]);         // n (last โ€” C# index-from-end)

// Slicing (Substring or range)
Console.WriteLine(name.Substring(0, 4));  // Alex
Console.WriteLine(name[5..]);             // Johnson (range syntax)

// Case changes
Console.WriteLine(name.ToUpper());   // ALEX JOHNSON
Console.WriteLine(name.ToLower());   // alex johnson

// Searching
Console.WriteLine(name.Contains("John"));  // True
Console.WriteLine(name.IndexOf("John"));   // 5

// Concatenation
string first = "Alex";
string last = "Johnson";
string full = first + " " + last;         // "Alex Johnson"

String Operations Compared

Operation ๐Ÿ Python โšก JavaScript ๐Ÿ”ท C#
Length len(s) s.length s.Length
Uppercase s.upper() s.toUpperCase() s.ToUpper()
Contains "x" in s s.includes("x") s.Contains("x")
Slice s[0:4] s.slice(0, 4) s.Substring(0, 4)
Last character s[-1] s[s.length - 1] s[^1]

โœ… Python's Negative Indexing

Python lets you count from the end using negative indices: s[-1] is the last character, s[-2] is second to last, and so on. JavaScript and C# don't support this natively (though C# has the ^ operator for a similar effect).

String Interpolation

String interpolation lets you embed variables and expressions directly inside a string. It's more readable than concatenation and you'll use it constantly.

name = "Alex"
age = 25
gpa = 3.847

# f-strings (Python 3.6+) โ€” prefix the string with f
print(f"Hi, I'm {name} and I'm {age} years old.")
# Hi, I'm Alex and I'm 25 years old.

# You can put expressions inside the braces
print(f"Next year I'll be {age + 1}.")
# Next year I'll be 26.

# Formatting numbers
print(f"GPA: {gpa:.2f}")   # GPA: 3.85 (2 decimal places)
print(f"{'Score':>10}: {95}")  # Right-align "Score" in 10 chars

# The old way (don't use these for new code):
# "Hi, I'm %s" % name          # % formatting
# "Hi, I'm {}".format(name)    # .format() method
let name = "Alex";
let age = 25;
let gpa = 3.847;

// Template literals โ€” use backticks ` and ${...}
console.log(`Hi, I'm ${name} and I'm ${age} years old.`);
// Hi, I'm Alex and I'm 25 years old.

// Expressions inside the braces
console.log(`Next year I'll be ${age + 1}.`);
// Next year I'll be 26.

// Formatting numbers (use .toFixed())
console.log(`GPA: ${gpa.toFixed(2)}`);  // GPA: 3.85

// IMPORTANT: must use backticks ` not regular quotes!
// "Hi ${name}" โ†’ literally prints ${name}  (WRONG)
// `Hi ${name}` โ†’ prints Hi Alex            (RIGHT)
string name = "Alex";
int age = 25;
double gpa = 3.847;

// Interpolated strings โ€” prefix with $ and use {โ€ฆ}
Console.WriteLine($"Hi, I'm {name} and I'm {age} years old.");
// Hi, I'm Alex and I'm 25 years old.

// Expressions inside the braces
Console.WriteLine($"Next year I'll be {age + 1}.");
// Next year I'll be 26.

// Formatting numbers
Console.WriteLine($"GPA: {gpa:F2}");    // GPA: 3.85
Console.WriteLine($"Price: {19.5:C}");  // Price: $19.50 (currency)

// The old way (still seen in older code):
// Console.WriteLine("Hi, I'm {0}", name);  // composite formatting

Interpolation Syntax Cheat Sheet

Feature ๐Ÿ Python โšก JavaScript ๐Ÿ”ท C#
Prefix f before the quote Use backticks ` $ before the quote
Variable placeholder {name} ${name} {name}
Expression support {age + 1} ${age + 1} {age + 1}
2 decimal places {val:.2f} ${val.toFixed(2)} {val:F2}

โš ๏ธ Common Mistakes with Interpolation

  • Python: Forgetting the f prefix โ†’ "{name}" prints literally {name}
  • JavaScript: Using regular quotes instead of backticks โ†’ "${name}" prints literally ${name}
  • C#: Forgetting the $ prefix โ†’ "{name}" prints literally {name}

The pattern is the same across all three: you need a special marker to activate interpolation.

๐ŸŽ“ Instructor Note: Delivery Guidance

String interpolation is arguably the most practical skill in this lesson. Students will use it in every single exercise going forward. Spend extra time here. Have students type the "wrong" version first (without the prefix) so they see the literal output, then add the prefix and see it come alive. This muscle memory of "f-string, backtick, dollar-sign" needs to be drilled.

Booleans

A boolean is the simplest type โ€” it can only be one of two values: true or false. Booleans are the foundation of decision-making in code.

# Python: True and False (MUST be capitalized!)
is_active = True
has_permission = False

# Comparison operators produce booleans
age = 25
print(age > 18)     # True
print(age == 30)    # False
print(age != 30)    # True
print(age >= 25)    # True

# Booleans are actually numbers in disguise!
print(True + True)    # 2
print(False + True)   # 1
print(int(True))      # 1
print(int(False))     # 0
// JavaScript: true and false (always lowercase!)
let isActive = true;
let hasPermission = false;

// Comparison operators produce booleans
let age = 25;
console.log(age > 18);     // true
console.log(age === 30);   // false (use === not ==)
console.log(age !== 30);   // true
console.log(age >= 25);    // true

// Booleans are numbers under the hood
console.log(true + true);    // 2
console.log(false + true);   // 1
console.log(Number(true));   // 1
console.log(Number(false));  // 0
// C#: true and false (always lowercase)
bool isActive = true;
bool hasPermission = false;

// Comparison operators produce booleans
int age = 25;
Console.WriteLine(age > 18);     // True
Console.WriteLine(age == 30);    // False
Console.WriteLine(age != 30);    // True
Console.WriteLine(age >= 25);    // True

// C# does NOT let you treat booleans as numbers
// Console.WriteLine(true + true);  // ERROR!
// You must convert explicitly:
Console.WriteLine(Convert.ToInt32(true));   // 1
Console.WriteLine(Convert.ToInt32(false));  // 0

โš ๏ธ JavaScript: Use === Not ==

JavaScript has two equality operators:

  • == (loose equality) โ€” converts types before comparing: "5" == 5 is true
  • === (strict equality) โ€” no conversion: "5" === 5 is false

Always use === and !== in JavaScript to avoid surprising type coercion bugs. Python and C# don't have this quirk.

Checking Types at Runtime

Sometimes you need to find out what type a value is. Each language has its own way:

# Python: use type() to see the type
print(type(42))         # <class 'int'>
print(type(3.14))       # <class 'float'>
print(type("hello"))    # <class 'str'>
print(type(True))       # <class 'bool'>

# Check if something IS a certain type
print(isinstance(42, int))       # True
print(isinstance("hi", str))    # True
print(isinstance(True, bool))   # True

# Fun fact: bool is a subtype of int in Python
print(isinstance(True, int))    # True!
// JavaScript: use typeof
console.log(typeof 42);         // "number"
console.log(typeof 3.14);       // "number"
console.log(typeof "hello");    // "string"
console.log(typeof true);       // "boolean"

// typeof has some quirks:
console.log(typeof null);       // "object" (a famous JS bug!)
console.log(typeof undefined);  // "undefined"
console.log(typeof [1,2,3]);    // "object" (arrays are objects)

// To check arrays specifically:
console.log(Array.isArray([1,2,3]));  // true
// C#: use .GetType() or the 'is' keyword
Console.WriteLine(42.GetType());       // System.Int32
Console.WriteLine(3.14.GetType());     // System.Double
Console.WriteLine("hello".GetType());  // System.String
Console.WriteLine(true.GetType());     // System.Boolean

// Check with 'is' keyword
object value = 42;
Console.WriteLine(value is int);       // True
Console.WriteLine(value is string);    // False

// C# rarely needs runtime type checks โ€” the compiler
// catches most type issues at compile time!

๐Ÿ’ก When Do You Check Types?

In practice, you check types most often in Python and JavaScript because they're dynamically typed โ€” a variable could hold anything. In C#, the compiler already knows every type, so runtime checks are less common.

Exercises

๐Ÿ‹๏ธ Exercise 1: Character Stats Card

Objective: Create a program that builds and displays a formatted character stats card using all three data types.

  1. Create variables for a character: name (string), level (int), health (float/decimal), and is_alive (boolean)
  2. Use string interpolation to display a formatted stats card
  3. Include at least one math operation (e.g., calculate a damage bonus from the level)
โœ… Solution
name = "Aria Shadowmend"
level = 12
health = 87.5
is_alive = True
damage_bonus = level * 1.5

print("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—")
print("โ•‘    CHARACTER STATS       โ•‘")
print("โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ")
print(f"โ•‘  Name:   {name}")
print(f"โ•‘  Level:  {level}")
print(f"โ•‘  Health: {health:.1f} HP")
print(f"โ•‘  Status: {'ALIVE' if is_alive else 'DEAD'}")
print(f"โ•‘  Damage: +{damage_bonus:.1f}")
print("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•")
let name = "Aria Shadowmend";
let level = 12;
let health = 87.5;
let isAlive = true;
let damageBonus = level * 1.5;

console.log("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—");
console.log("โ•‘    CHARACTER STATS       โ•‘");
console.log("โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ");
console.log(`โ•‘  Name:   ${name}`);
console.log(`โ•‘  Level:  ${level}`);
console.log(`โ•‘  Health: ${health.toFixed(1)} HP`);
console.log(`โ•‘  Status: ${isAlive ? "ALIVE" : "DEAD"}`);
console.log(`โ•‘  Damage: +${damageBonus.toFixed(1)}`);
console.log("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•");
string name = "Aria Shadowmend";
int level = 12;
double health = 87.5;
bool isAlive = true;
double damageBonus = level * 1.5;

Console.WriteLine("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—");
Console.WriteLine("โ•‘    CHARACTER STATS       โ•‘");
Console.WriteLine("โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ");
Console.WriteLine($"โ•‘  Name:   {name}");
Console.WriteLine($"โ•‘  Level:  {level}");
Console.WriteLine($"โ•‘  Health: {health:F1} HP");
Console.WriteLine($"โ•‘  Status: {(isAlive ? "ALIVE" : "DEAD")}");
Console.WriteLine($"โ•‘  Damage: +{damageBonus:F1}");
Console.WriteLine("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•");

๐Ÿ‹๏ธ Exercise 2: String Detective

Objective: Practice string operations by analyzing a sentence.

  1. Store the sentence "The quick brown fox jumps over the lazy dog" in a variable
  2. Print the total number of characters
  3. Print the first word and the last word
  4. Print the sentence in all uppercase
  5. Check whether the sentence contains the word "cat" and print the result
โœ… Solution
sentence = "The quick brown fox jumps over the lazy dog"

print(f"Length: {len(sentence)}")
print(f"First word: {sentence[0:3]}")
print(f"Last word: {sentence[-3:]}")
print(f"Uppercase: {sentence.upper()}")
print(f"Contains 'cat': {'cat' in sentence}")
let sentence = "The quick brown fox jumps over the lazy dog";

console.log(`Length: ${sentence.length}`);
console.log(`First word: ${sentence.slice(0, 3)}`);
console.log(`Last word: ${sentence.slice(-3)}`);
console.log(`Uppercase: ${sentence.toUpperCase()}`);
console.log(`Contains 'cat': ${sentence.includes("cat")}`);
string sentence = "The quick brown fox jumps over the lazy dog";

Console.WriteLine($"Length: {sentence.Length}");
Console.WriteLine($"First word: {sentence.Substring(0, 3)}");
Console.WriteLine($"Last word: {sentence[^3..]}");
Console.WriteLine($"Uppercase: {sentence.ToUpper()}");
Console.WriteLine($"Contains 'cat': {sentence.Contains("cat")}");

๐Ÿ‹๏ธ Exercise 3: Type Explorer

Objective: Experiment with types and see what happens.

  1. Create a variable with the value 10 and print its type
  2. Create a variable with the value 10.0 and print its type
  3. Create a variable with the value "10" and print its type
  4. Try adding a number and a string โ€” what happens in each language?
๐Ÿ’ก Hint

Python will throw an error if you try to add a number and a string. JavaScript will silently convert one to match the other. C# will give a compile error. These behaviors preview next lesson's topic: type conversion!

โœ… Solution
a = 10
b = 10.0
c = "10"

print(type(a))  # <class 'int'>
print(type(b))  # <class 'float'>
print(type(c))  # <class 'str'>

# Adding number + string:
# print(a + c)  # TypeError: unsupported operand type(s)
# Python refuses โ€” you must convert explicitly:
print(a + int(c))   # 20
print(str(a) + c)   # "1010"
let a = 10;
let b = 10.0;
let c = "10";

console.log(typeof a);  // "number"
console.log(typeof b);  // "number" (same as a!)
console.log(typeof c);  // "string"

// Adding number + string:
console.log(a + c);     // "1010" (JS converts number to string!)
// JavaScript chose string concatenation โ€” surprise!
// Use Number() or parseInt() to force numeric addition:
console.log(a + Number(c));  // 20
int a = 10;
double b = 10.0;
string c = "10";

Console.WriteLine(a.GetType());  // System.Int32
Console.WriteLine(b.GetType());  // System.Double
Console.WriteLine(c.GetType());  // System.String

// Adding number + string:
Console.WriteLine(a + c);  // "1010" (C# converts to string)
// To get numeric addition, convert first:
Console.WriteLine(a + int.Parse(c));  // 20
๐ŸŽ“ Instructor Note: Delivery Guidance

Exercise 3 is the most important pedagogically because it naturally sets up the next lesson on type conversion and coercion. Let students struggle with the number + string problem โ€” the three different behaviors (Python: crash, JS: concatenate, C#: concatenate) are a great discussion point about language design philosophy. Python says "explicit is better than implicit," JavaScript tries to be helpful (sometimes too helpful), and C# splits the difference.

Summary

๐ŸŽ‰ Key Takeaways

  • Numbers: Python has int/float, JavaScript has just number, C# has int/double/decimal and more
  • Strings: Text data enclosed in quotes โ€” all three languages support concatenation, indexing, slicing, searching, and case changes
  • String Interpolation: Python: f"...", JavaScript: `...${}`, C#: $"...{}" โ€” learn these and use them everywhere
  • Booleans: True/false values used for decisions โ€” Python capitalizes them (True/False), JS/C# don't
  • Type matters: 5 + 3 = 8, but "5" + "3" = "53" โ€” the type determines the behavior
  • Watch out for C# integer division and JavaScript's == vs ===

๐Ÿš€ What's Next?

Now that you know the types, what happens when you need to convert between them? In the next lesson, we tackle type conversion and coercion โ€” including JavaScript's famously surprising behavior.

๐ŸŽฏ Quick Check

Question 1: What does 17 / 5 produce in C# when both values are int?

Question 2: Which is the correct way to use string interpolation in JavaScript?

Question 3: In Python, what does "5" + 3 produce?