Remove First Character

Remove first character from string.

Logic BuildingBeginner
Logic Building
# Take string input
s = input("Enter a string: ")

# Remove first character
if len(s) > 0:
    result = s[1:]
    print(f"After removal: {result}")
else:
    print("String is empty")

Output

Enter a string: Hello
After removal: ello

Use slicing to skip first character.

Key Concepts:

  • s[1:] skips first character
  • Returns substring
  • Check if string not empty