livepython.net

6. Python Program to Create a Name Card Using Tabs

EasyEscape sequences

Overview

This task focuses on the use of escape sequences in Python, specifically the \t tab character. By completing this exercise, you will learn how to create neatly formatted output using tabs in your string.

Problem Statement

Write a Python program that prints a name card using tabs for alignment. The output should look like this:

Name: Rahul
Age: 20
Gender: Male

Input

  • No input is required.

Output

Your output should match the following format exactly:

Name: Rahul
Age: 20
Gender: Male

Hints:

  • Use the \t escape sequence to add tabs for alignment in your print() statement.
  • Ensure the format of your output matches exactly, including spacing, capitalization, and punctuation.

Take your time and practice formatting outputs for professional results!

Learn this firstChapter 2 · Escape Sequences in Python: \n, \t and More
solution.py
# write your code here

EXPECTED OUTPUT

1Name: Rahul
2Age: 20
3Gender: Male

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.