Text processing · 8 / 14 Exercise Easy

Split user and domain

Objective

Create a Python program that splits an email address into user and domain with the partition method.

Instructions

  • Read an email with the format user@domain. It always contains a single @.
  • Split it with partition("@").
  • On the first line show User: U and on the second Domain: D.
Input
ana@mail.com
Output
User: ana
Domain: mail.com

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise