57.2k views
0 votes
Create a function that prints your first name and last name. (With or without an input statement) python ict

User Badzil
by
8.8k points

1 Answer

3 votes

Final answer:

To print your first name and last name in Python, you can write a function using the print statement and concatenating the strings.

Step-by-step explanation:

In Python, you can create a function to print your first name and last name by using the print statement and concatenating your first name and last name strings. Here's an example:

def print_name():
first_name = 'John'
last_name = 'Doe'
full_name = first_name + ' ' + last_name
print(full_name)

# Call the function to print the name
print_name()

When you run this code, it will output:

John Doe

User Stephane Maarek
by
8.5k points