O Level Exam : Practical Question
📝 HTML
🎨 CSS
⚡ Java Script
sentence = input("Enter a sentence: ") # Display first 5 characters first_five = sentence[:5] # Display last 5 characters last_five = sentence[-5:] print("First 5 characters:", first_five) print("Last 5 characters:", last_five) # Concatenate with another predefined string extra = " - Thank you!" new_sentence = sentence + extra print("Concatenated sentence:", new_sentence)
▶ Run Code
🖥 Output: