2.py 213 B

12345678910
  1. import os
  2. # Clear screen
  3. os.system("clear") # Mac or Linux
  4. #os.system("cls") # Windows
  5. userInput = input("Input a longer string: ")
  6. # Print substring, from start to position 3 of userInput
  7. print(userInput[:3])