What will be the output of the following Python code?Questions & Answers › Category: Python › What will be the output of the following Python code? 0 Vote Up Vote Down Lokesh Kumar Staff asked 3 years ago What will be the output of the following Python code?>>>str="hello" >>>str[:2] >>> a. he b. lo c. olleh d. helloShare this: Share on Facebook (Opens in new window) Facebook Share on X (Opens in new window) X Share on WhatsApp (Opens in new window) WhatsApp Print (Opens in new window) Print Share on LinkedIn (Opens in new window) LinkedIn Share on Pinterest (Opens in new window) Pinterest Like this:Like Loading...1 Answers 0 Vote Up Vote Down Lokesh Kumar Staff answered 3 years ago a. heExplanation: We are printing only the 1st two bytes of string and hence the answer is βheβ.Share this: Share on Facebook (Opens in new window) Facebook Share on X (Opens in new window) X Share on WhatsApp (Opens in new window) WhatsApp Print (Opens in new window) Print Share on LinkedIn (Opens in new window) LinkedIn Share on Pinterest (Opens in new window) Pinterest Like this:Like Loading...