Generate a list of the Instructor names by combining "Professor " and the first name, 1 space, and last name togethe
Question
Generate a list of the Instructor names by combining "Professor "
and the first name, 1 space
, and last name together.
Solution
To generate a list of instructor names by combining "Professor ", the first name, a space, and the last name together, you would follow these steps:
- First, you need to have a list of the instructors' first and last names. This could be in the form of a list of dictionaries, a list of tuples, or two separate lists. For this example, let's assume you have a list of dictionaries, where each dictionary represents an instructor and has keys for 'first_name' and 'last_name'.
instructors = [
{'first_name': 'John', 'last_name': 'Doe'},
{'first_name': 'Jane', 'last_name': 'Smith'},
# Add more instructors as needed
]
- Next, you would iterate over this list and for each instructor, concatenate "Professor ", the first name, a space, and the last name.
professor_names = []
for instructor in instructors:
name = "Professor " + instructor['first_name'] + " " + instructor['last_name']
professor_names.append(name)
- Now,
professor_names
is a list of strings, where each string is an instructor's name prefixed with "Professor ".
Please note that this is a Python solution. The exact code may vary depending on the programming language you're using.
Similar Questions
Use a Self Join and display the last name of each Instructor and the last name of their Department Chair. Label each column
Develop a Java program to add student’s names and display it using vectorclass.
Create and print a linked list with four (4) elements. The first letter of your last name will be the basis of the required values for your linked list.
Show first name and last name concatinated into one column to show their full name.
Write a MySQL statement to sort the students in descending order of the last name
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.