Answers to code practice 1.7 on edhesive. Says "Write a program that asks the user to input their first and last names. The first prompt should state:
Please input your first name:
The second prompt should state:
Please input your last name:
After accepting the inputs, your program should output the input in the form last name, first name.
Answers
In Python, the code will be as follows :-
name1 = str(input("Enter your first name : "))
name2 = str(input("Enter your last name : "))
print("Your name in the format <last name> <first name> is " + name1 + name2)
Hope this answer helps...
Answer:
In Python, the code will be as follows :-
name1 = str(input("Enter your first name : "))
name2 = str(input("Enter your last name : "))
print("Your name in the format <last name> <first name> is " + name1 + name2)
Explanation:
name = str(input("Your first and last names? "))
gap = name.find(" ")
name_length = len(name)
first = name[0:gap]
last = name[gap + 1 : name_length]
if name_length is 2:
print("Name: ", last.upper(), ", ", first.capitalize(), sep = "")
else:
print("ERROR: only one name found")
name = input("Your first and last name: ").split(" ")
if len(name) == 2:
print("Name: ", name[0].upper(), ", ", name[1].capitalize(), sep = "")
else:
print("ERROR: unknown number of names found!")
print("Enter your First and Last Name")
name = raw_input()
first,last = name.split()
print("Your FirstName:")
print(last.upper())
print("Your LasttName:")
print(first.lower())
x=input("Your first and last names : ").split()
if(len(x)<=1):
print("name does not contain lastname or whole name is not mentioned ")
else:
print(x[1]+" "+x[0])
fname = input("Input your First Name : ")
lname = input("Input your Last Name : ")
print ("Hello " + lname + " " + fname)
first_name = input('Please input your first name: ')
last_name = input('Please input your last name: ')
print(last_name + ', ' + first_name)
Learn more about similar questions visit:
https://brainly.in/question/24632132?referrer=searchResults
https://brainly.in/question/55020410?referrer=searchResults
#SPJ3