Ask Question
29 March, 15:16

Assume that word is a variable of type String that has been assigned a value. Write an expression whose value is a String consisting of the first three characters of the value of word. So if the value of word were dystopia" the expression's value would be "dys"."

+2
Answers (1)
  1. 29 March, 17:40
    0
    Follwing is the python code:-

    word=str (input ("Enter the string/n"))

    new=word[0:3] #expression for first three characters of the string.

    print (new)

    Output:-

    Enter the string

    chandelier

    cha

    Explanation:

    The expression word[0:3] is for extracting first three characters form the string.

    word[0:3] = It extracts characters from index 0 to index 2 it does not include 3.3 is excluded.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Assume that word is a variable of type String that has been assigned a value. Write an expression whose value is a String consisting of the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers