subject

Write a function called name_facts that will take a firstname (string) as an input parameter, and print out various facts about the name, including:

1) its length,

2) whether it starts with the letter A, and

3) whether it contains a Z or X.

To gain full credit for this exercise, you must use string formatting to print out the result.

Hints:

You will probably want to convert the string to lowercase when checking conditions 2 and 3. You can get by without it, but you'll have to make sure you check both lower and uppercase versions of the letters
You will have to use the in operator for condition 3
You will also probably want to make a separate message for conditions 2 and 3 (depending on the answer) and use string formatting to join them into the final message
Example output:

Given "Allegra" as input: Your name is 7 letters long, does start with the letter A, and does not contain a Z or X
Given "Xander" as input: Your name is 6 letters long, does not start with the letter A, and does contain a Z or X

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:30
Complete the sentence based on your knowledge of the professional difficulties faced by music artists. digital technology allows audiences to see free live telecasts of music or dance performances through
Answers: 1
question
Computers and Technology, 23.06.2019 12:20
When guido van rossum created python, he wanted to make a language that was more than other programming languages. a. code-based b. human-readable c. complex d. functional
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Stops: using the information learned in this course, explain three things you will not do when driving. a. b. c. explain why you will not do these things when driving. starts: using the information learned in this course, explain three things you will do when driving. a. b. c. explain why you will do these particular things when driving. explain one thing you will stop doing as a passenger. explain one thing you will start doing as a passenger.
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Ramona enjoys her job because she is able to kids in an after school program. the work value ramona feels strongest about is a. leadership b. risk c. independence d. work with people select the best answer from the choices provided a b c d
Answers: 1
You know the right answer?
Write a function called name_facts that will take a firstname (string) as an input parameter, and pr...
Questions
question
Mathematics, 21.09.2020 14:01
question
Engineering, 21.09.2020 14:01
question
Mathematics, 21.09.2020 14:01
question
History, 21.09.2020 14:01
Questions on the website: 13722367