Buy:
|
What's your elf name? (Step-by-step tutorial)
How it works
Find your elf’s name in two short and easy steps. Find the first letter of your first name. For example, if your first name is “Francis”, then your elf’s first name is “Festive”. Now find the first letter of your last name. For example, if your last name is “Smith”, then your elf’s last name is “Snowball”. That’s it!
Elf names
First letter of your first name
Find the first letter of your first name. For example, if your first name is “Francis”, then your elf’s first name is “Festive”.
Find the first letter of your first name. For example, if your first name is “Francis”, then your elf’s first name is “Festive”.
Initial | Name | Initial | Name |
---|---|---|---|
A. | Angelic | N. | Naughty |
B. | Blustery | O. | Oily |
C. | Cheery | P. | Pointy |
D. | Dancy | Q. | Quirky |
E. | Elfie | R. | Rosie |
F. | Festive | S. | Snowy |
G. | Glistening | T. | Tinsel |
H. | Happy | U. | Unity |
I.. | Icy | V. | Very Merry |
J. | Jolly | W. | Wintry |
K. | Kringle | X. | Xmasy |
L. | Lucky | Y. | Yule |
M. | Merry | Z. | Zippy |
First letter of your last name
Find the first letter of your last name. For example, if your last name is “Smith”, then your elf’s last name is “Snowball”.
Find the first letter of your last name. For example, if your last name is “Smith”, then your elf’s last name is “Snowball”.
Initial | Name | Initial | Name |
---|---|---|---|
A. | Angel | N. | Noel |
B. | Bells | O. | Ornament |
C. | Candy Cane | P. | Peppermint |
D. | Dash | Q. | Quince Pie |
E. | Evergreen | R. | Ribbon |
F. | Feet | S. | Snowball |
G. | Gingerbread | T. | Toes |
H. | Holidays | U. | Upatree |
I.. | Icicles | V. | Vixen |
J. | Jingles | W. | Wonderland |
K. | Kringles | X. | Xmas |
L. | Lights | Y. | Yuletide |
M. | McSnowface | Z. | Zest |
Start by inputting the following code: :
SantasList = {"ANGELA": "Nice", "BILLY": "Naughty", "DUNCAN": "Nice"}
childsName = input("Enter child’s name: ") result = SantasList[childsName] print("Naughty or nice?: " + result) |
Run and test your code.
The code above uses a feature in Python called a dictionary which is a collection of items containing a “key” and a “value”.
Challenge 1:
Modify the code to include some of your own the names.
Question:
What happens if you don’t enter a name all in upper case?
We can convert a user’s input to uppercase using .upper(). Try adding the following code after line 2:
The code above uses a feature in Python called a dictionary which is a collection of items containing a “key” and a “value”.
Challenge 1:
Modify the code to include some of your own the names.
Question:
What happens if you don’t enter a name all in upper case?
We can convert a user’s input to uppercase using .upper(). Try adding the following code after line 2:
childsName = childsName.upper()
|
Challenge 2:
Create your own Elf name generator by filling in the gaps in the code below:
Create your own Elf name generator by filling in the gaps in the code below:
Example solution:
whats_your_elf_name.zip |
Challenge 3:
Modify your code so that the user to enters their full name and the program automatically extracts the first letter from the first name and last name. For example:
Modify your code so that the user to enters their full name and the program automatically extracts the first letter from the first name and last name. For example:
firstName = input("What is your first name? ")
firstInitial = firstName[0].upper() |
Bonus Challenge
Create your own name generator. For example, superhero or gamer name generator etc.
Create your own name generator. For example, superhero or gamer name generator etc.