Feb-27-2019, 11:45 AM
Thank you all for your replies.
I have tried the below:-
This is a section from the question instruction:-
"#Add some code below that uses those operators to modify
#mystery_string such that its value at the end of the
#program is: ABCDE.ABCDE.ABCDE.??? Then, print the final
#value of mystery_string.
#
#You should not create any new strings longer than one
#character. We'll test your code with a couple other
#variants on mystery_string, but in all cases the results
#should be the same: the string repeated three times with
#a period after each repetition and three question marks
#at the end."
Below is what I entered into the Python IDLE on my desktop and got the correct response:-
ABCDE.ABCDE.ABCDE.???
>>>
please neter the variable: VWXYZ
VWXYZ.VWXYZ.VWXYZ.???
>>>
I put the same into the test environment:-
VWXYZ.VWXYZ.VWXYZ.???
However, it printed this:
EOFError: EOF when reading a line
We tested your code with mystery_string = "ZSYNP". We expected your code to print this:
ZSYNP.ZSYNP.ZSYNP.???
However, it printed this:
EOFError: EOF when reading a line
I have tried the below:-
This is a section from the question instruction:-
"#Add some code below that uses those operators to modify
#mystery_string such that its value at the end of the
#program is: ABCDE.ABCDE.ABCDE.??? Then, print the final
#value of mystery_string.
#
#You should not create any new strings longer than one
#character. We'll test your code with a couple other
#variants on mystery_string, but in all cases the results
#should be the same: the string repeated three times with
#a period after each repetition and three question marks
#at the end."
Below is what I entered into the Python IDLE on my desktop and got the correct response:-
[b]mystery_string = "ABCDE" mystery_string = input("please enter a variable: ") print((mystery_string+".")*3+"???")[/b]please neter the variable: ABCDE
ABCDE.ABCDE.ABCDE.???
>>>
please neter the variable: VWXYZ
VWXYZ.VWXYZ.VWXYZ.???
>>>
I put the same into the test environment:-
[b]mystery_string = "ABCDE" mystery_string = input("please enter a variable: ") print((mystery_string+".")*3+"???")[/b]We tested your code with mystery_string = "VWXYZ". We expected your code to print this:
VWXYZ.VWXYZ.VWXYZ.???
However, it printed this:
EOFError: EOF when reading a line
We tested your code with mystery_string = "ZSYNP". We expected your code to print this:
ZSYNP.ZSYNP.ZSYNP.???
However, it printed this:
EOFError: EOF when reading a line