Missing the Big Sweat Globs on account of focus on the Small Stuff in them
The two previous posts (here) and (here) did not go as planned.
Too much caught in the details (in the weeds) and then no time or energy for pointing out the big picture --or more correctly answering the subsuming question, which is:
Why would I want to skip some of the tutorial exercises in my "Learn or Review List Methods" Python program in the first place?
By the way, it worked. I converted the first tutorial into a function and put in a conditional return based on one of the items in my skip_diz list. Here is part of the code:
TO BE CONTINUED
def choice_of_die_outcomes(method_ID_numb, method_name, verb, skip_diz_list_a): #-- last arg is a skip control
if skip_diz_list_a[method_ID_numb] == 1:
print(f'method number {method_ID_numb} has been skipped\n')
return None #--skip this tutorial if skip position for tutorial 01 is set to 1
face_imgs_row1 = ['🤬', '🧐', '🤓🤓', '😲😲', '🤩🤩', '😋 🤪', '🤠🤠🤠' ]
face_imgs_row2 = ['☠️', ' ', ' ', '😲', '🤩🤩', '😋😛🤪', '🤠🤠🤠' ]
print('\n\n', '-' * 20)
dice_faces: int = range(1,7) #-- generates a sequence (not list) of integers 1-6 (default start of range is 0)
go_again = 'y'
while go_again == 'y':
roll_1 = choice(dice_faces)
roll_2 = choice(dice_faces)
print(f'\n#:00; example of random choice made with the CHOICE() function')
print(f' 1st die roll gives you a \t{roll_1}\t{face_imgs_row1[roll_1]}')
print(f' \t\t\t\t\t\t\t\t{face_imgs_row2[roll_1]}\n')
print(f' 2nd die roll gives you a \t{roll_2}\t{face_imgs_row1[roll_2]}')
print(f' \t\t\t\t\t\t\t\t{face_imgs_row2[roll_2]}\n')
print(f' The SUM of the two rolls is \t{roll_1 + roll_2} \n')
go_again = input('Try again? Enter y or other here__')
halt4_food(method_ID_numb, method_name, verb, face_imgs_row1, #-- HALT here for challenge question
face_imgs_row2)
choice_of_die_outcomes(method_ID_numb, method_name, verb, skip_diz_list_a) #-- execute the above function here
The above code snippet uses the CHOICE() function to implement a simple toss of two die and to report the outcome with numbers as well as graphics.
More importantly, at the end of the function, it calls on a "Food for Thought" function which asks the reader, what other practical uses can you think of for the CHOICE() method?
One of the ideas I came up with was to use CHOICE() to randomly toggle the settings in the skip-this control list such that different tutorials pop up withe each run of the Learn_List_Methods program.
They say that variety is the spice of life. Thus if we surprise the learner with randomly picked challenges, it makes the learnnng process more interesting. No?
Comments
Post a Comment