Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

mystery _ string = Lucy #You may modify the lines of code above, but don't move them! #When you Submit your code, we'll change these

mystery_string = "Lucy"
#You may modify the lines of code above, but don't move them!
#When you Submit your code, we'll change these lines to
#assign different values to the variables.
#There's an easy way to do this exercise, and a hard way. For
#a hint on the easier way, revisit the sample answers for the
#previous coding exercise.
#
#Above we've created a variable called mystery_string. Write
#some code that will print the first letter of the string on
#the first line, the first two letters on the second line,
#the first three letters on the third line, etc., until it
#prints the entire string on the last line.
#
#For example, if the string was "Lucy", then the output would
#be:
#
#L
#Lu
#Luc
#Lucy
#
#Hint: to print without automatically starting a new line,
#include the text end="" inside the print statement's
#parentheses. For example, print("Hello", end="") will print
#the word "Hello" without starting a new line afterward. So,
#calling it twice would print "HelloHello" on one line
#instead of two lines.
#Add your code here!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started