I am building a book that will only contain a large set of problems in python for students to use to practice their coding skills -- similar, I guess, to
turingscraft.com.
I regularly want to have the students have to write code that assumes some other code exists and has been run. E.g.,
Assume you have two variables hours and hourly_rate. Write code to compute the total_pay, by multiplying hours and hourly_rate and storing in total_pay.
I don't want to give them the code that creates the two variables, hours and hourly_rate.
I know that I can do this by using :include: of another problem. However, I don't really want to have another problem that just has two lines of code in it, defining hours and hourly_rate and giving them values.
Is there a way to create a "hidden" activecode block so that it can be :include:d in another block?
Thanks.
Vic