Problem 164501 · easy · Phase 01 Prerequisites & Setup

Skip Every Other Letter

strings · slicing

A cheap printer only manages to print every second character. Given a string s, return the characters at positions 0, 2, 4, ... joined into one string.

Examples

Input:  s = "abcdef"
Output: "ace"

Input:  s = "Hello World"
Output: "HloWrd"

Constraints

  • 0 <= len(s) <= 2000
  • s may contain any printable characters

Goals

  • Use a slice with a step
  • Return characters at even positions
Starting Python…