DEV Community

Cover image for The Office, Built with Strings
Muhammad
Muhammad

Posted on

The Office, Built with Strings

My simple Python Employee Info Card project that helps users create a basic employee profile then also displays the details in a clear and easy way. Basically, it turns the boring office task into Python practice.

The Employee Info Card

first_name = "John" # Place Holder
last_name = "Doe" # Place Holder

full_name = first_name + " " + last_name
address = "123 Main Street" # Place Holder
address += ", Apartment 4B" # Place Holder

employee_age = 28 # Place Holder

employee_info = full_name + " is " + str(employee_age) + " years old"
print(employee_info)

experience_years = 5 # Place Holder
experience_info = "Experience: " + str(experience_years) + " years"

print(experience_info)
position = "Data Analyst" # Place Holder

salary = 75000 # Place Holder
employee_card = f"Employee: {full_name} | Age: {employee_age} | Position: {position} | Salary: ${salary}"

print(employee_card)
employee_code = "DEV-2026-JD-001" # Place Holder

department = employee_code[0:3]
print(department)
year_code = employee_code[4:8]
print(year_code)
initials = employee_code[9:11]
print(initials)
last_three = employee_code [-3:]
print(last_three)
Enter fullscreen mode Exit fullscreen mode

Features


  • Combines first and last name into a full name
  • Adds extra address details using string concatenation
  • Creates an experience summary
  • Formats an employee card with name, age, position, and salary
  • Uses an f-string to display information neatly
  • Extracts information from their employee code

Top comments (0)