Skip to the content.

3.4 Homework

hw for 3.4 lesson

// Find the number of characters in your last name.

// Example:

let last_name = "Manalo";
let length = last_name.length;

console.log(length);

// Merge your first and last name together.

// Example: 

let name = "Abby" + " " + "Manalo";

console.log(name);

// Show only the 2rd to 8th characters in your name

// Example:

let substring = name.substring(1,8);

console.log(substring);
# Find the number of characters in your last name using len.

# Example:

length = len("Manalo")
print(length)

# Use concat to merge your first and last name together.

# Example:

concat_string = "Abby" + "Manalo"
print(concat_string)

# Use substring to show only the 3rd to 6th characters

# Example:

substring = concat_string[2:6]
print(substring)