Aug-15-2018, 04:57 AM
I inserted my prompt text with spacing as needed. Since this type of question requires multiple lines of code without a space between lines I removed the last else statement from the algorithm.
I tested it fully with wrong answers on the first thru the forth iteration and this is my final output, fully tested and working. Only needed minor adjustments based on my requirements.
This is q2a, the first of seven segments to answer without further prompt, line after line without any blank spacing between lines of code. For multi segmented lines of output, I have to create a code snippet like this in three slightly different variations based on if the segment is the very first segment, a mid segment or the final segment.
I tested it fully with wrong answers on the first thru the forth iteration and this is my final output, fully tested and working. Only needed minor adjustments based on my requirements.
This is q2a, the first of seven segments to answer without further prompt, line after line without any blank spacing between lines of code. For multi segmented lines of output, I have to create a code snippet like this in three slightly different variations based on if the segment is the very first segment, a mid segment or the final segment.
for guess in range(4): q2a = input('Construct the minimal BOILER PLATE HTML Template answer NOW: \n\n') if q2a == '<!DOCTYPE html>': break if guess == 1: #if user guesses wrong answer on the second try, a hint is provided print('') print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') print('HINT: This line of code requires the HTML5 tag, no indent, then hit the ENTER KEY and code the next line') print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') print('') elif guess == 3: #if user guesses wrong answer on the forth try, the answer is provided print('') print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') print('ANSWER: <!DOCTYPE html> Type in this answer NOW, then hit the ENTER KEY and code the next line') print('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@') print('') q2a = input() #the cursor is waiting for user to type in the answer given to them else: print(wrong) #a global wrong text message is printed to screen # else: # print('Correct answer.') #remove or move this based on single or multiple answer questions, NO MULTI q2b()Thank you Ichabod801 for the awesome code, does this forum give me the option to mark as DONE or give you a rating?