Question

Write a statement that slices the last 8 characters of the string variable directions and puts...

Write a statement that slices the last 8 characters of the string variable directions and puts its result into a variable named selection.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Prerequisites:

  • The last 8 characters of string direction need to be sliced and stored in the string selection.

Statement Code:
direction="coronavirus";
//slicing by taking the first character as last 8th character and step is by default 1
selection=direction[slice(len(direction)-8,None,None)];
print selection;

Screenshots:

Friend, this was a really nice question to answer. If you find my answer helpful, please like it. Thanks.

Add a comment
Know the answer?
Add Answer to:
Write a statement that slices the last 8 characters of the string variable directions and puts...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT