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 17:00
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen tool
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
Match the following. 1. show grouping of word processing tasks that can be performed quick access toolbar 2. shortcut location for commonly used elements scroll bars 3. organized commands used to modify documents ribbon 4. used to align and measure content in a word screen zoom bar 5. vertical and horizontal bars that are used to navigate through a document contextual tabs 6. displays the name of the document in use ruler 7. allows users to enlarge or shrink a visual of a word document title bar
Answers: 2
question
Computers and Technology, 23.06.2019 09:10
Effective character encoding requires standardized code. compatible browsers. common languages. identical operating systems.
Answers: 1
question
Computers and Technology, 24.06.2019 13:00
Refer to the figure and match the theorem that supports the statement.1.if chords are =, then arcs are =.if bc = de, then arc bc = arc de2.if arcs are =, then chords are =.if arc bc = arc de, then bc = de3.diameters perpen
Answers: 3
You know the right answer?
Write a function called name_facts that will take a firstname (string) as an input parameter, and pr...
Questions
Questions on the website: 13722363