Ladataan tehtävää…
Programs often need to quickly take the beginning of a text, such as a short prefix, the first letters of a name, or part of a code. Write a function first_two that takes a string s and returns its first two characters. If the string has fewer than two characters, return the whole string.
"Hello""He""abcdefg""ab""ab""ab"def first_two(s: str) -> str:
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisään"Hello""He""abcdefg""ab""ab""ab""a""a""""""abc""ab"