"""
Write a program to ask the user to enter their first name,
last name and age and write it to a specific file in a specific format.

The file is called userdata.txt.  The file is in the same directory as the program.

The data is to be written to the file as follows

Initial of first name followed by last name followed by age.

Assume the entered age will be two digits.

Assume all input will be valid, the data will validated in a later lab.

There is no CrLf at the end of the line.


Example
Please enter your first name: Young
Young, please enter your last name: Person
Please enter your age: 18


Example
Please enter your first name: old
Old, please enter your last name: person
Please enter your age: 42


In the first example above, userdata.txt will contain

YPerson18

In the second example above, userdata.txt will contain

OPerson42

Hints

Remember string slicing and string concatenation.
Treat all input as strings.
Strip spaces and capitalise names.
Strip spaces from the age.
The solution is about 11 lines of code.


Moodle will report extra output that is generated by the additional code present in CodeRunner.
The additional code is there to check the contents of the file.  Your output must look like the examples above.
"""

# Auth: Michael Devenport
# Email: croxleyway@gmail.com

# Quest: lab9-2-1_q1


first_name = input("Please enter your first name: ").strip().capitalize()
last_name = input("{}, please enter your last name: ".format(first_name)).strip().capitalize()
age = input("Please enter your age: ").strip()

user_data = open("userdata.txt", 'w')
user_data.write(first_name[:1] + last_name + age)
user_data.close()
