Ad
Strings
Data Types
Iterators
Control Flow
Object-oriented Programming
Basic Language Features
Fundamentals
Programming Paradigms

Given a string, complete the function so it returns the string with every 2nd character removed.

example:

removeEverySecond('hello world') should return 'hlowrd' ```
Code
Diff
  • def removeEverySecond(string):
        # Your code goes here
        return string[::2]
    • removeEverySecond=\
    • lambda s:s[::2]
    • def removeEverySecond(string):
    • # Your code goes here
    • return string[::2]