1) Display the number of jokes in jokes.txt
2) Ask the user for the number of a joke
3) Display the joke
4) Display the requested joke
5) Display the requested answer
import os
# This program has read/write access to the WORKSPACE directory
jokes_filepath = os.path.join( os.environ['WORKSPACE'], 'jokes.txt' )
answers_filepath = os.path.join( os.environ['WORKSPACE'], 'answers.txt' )
# The testing system will let this program know how many lines to expect
num_of_lines = int( input() )
# Copy input into the files. Do not modify!
with open( jokes_filepath, 'w' ) as jokes_file:
with open( answers_filepath, 'w' ) as answers_file:
for _ in range( num_of_lines ):
jokes_file.write( input() + '\n' )
answers_file.write( input() + '\n' )
# Write your program below
1
Expert's answer
2019-10-30T06:52:27-0400
Dear yousif, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Comments
Leave a comment