top of page

Forum Comments

1/4 - Class 14 HW + Resources
In Introduction to Python
jliu.mky
Jan 15, 2022
import random deck = ["C_Jack", "C_Queen", "C_King", "C_Ace", "C_2", "C_3", "C_4", "C_5", "C_6", "C_7", "C_8", "C_9", "C_10", \ "D_Jack", "D_Queen", "D_King", "D_Ace", "D_2", "D_3", "D_4", "D_5", "D_6", "D_7", "D_8", "D_9", "D_10", \ "H_Jack", "H_Queen", "H_King", "H_Ace", "H_2", "H_3", "H_4", "H_5", "H_6", "H_7", "H_8", "H_9", "H_10", \ "S_Jack", "S_Queen", "S_King", "S_Ace", "S_2", "S_3", "S_4", "S_5", "S_6", "S_7", "S_8", "S_9", "S_10"]; hand = []; def shuffle(list_in): list_out = random.choices(list_in, k = len(list_in)); return list_out; print("Original deck"); print(deck); deck = shuffle(deck); print("\nDeck after shuffle"); print(deck); print('\nWhat is your choice, "Draw", "Shuffle", "Deck", "Hand" or "Stop"?'); user_input = input(); while user_input.lower() != "stop": if user_input.lower() == "draw": print('How many cards do you want to draw?') n = int(input()); my_draw = []; if n <= 0 or n > len(deck): print(f'Your choice {n} is out of range, default to one'); n = 1; while n > 0: my_draw.append(deck.pop(0)); n -= 1; hand = hand + my_draw; print(f'\nYou drew {my_draw}'); elif user_input.lower() == "shuffle": print("\nOriginal deck"); print(deck); deck = shuffle(deck); print("\nDeck after shuffle"); print(deck); elif user_input.lower() == "hand": print('\nHere is what you have in your hand') print(hand); elif user_input.lower() == "deck": print('\nHere is what the deck has') print(deck); print('\nWhat is your choice, "Draw", "Shuffle", "Deck", "Hand" or "Stop"?'); user_input = input();
0
0
10/12 - Class 5 HW + Resources
In Introduction to Python
jliu.mky
Oct 26, 2021
story1_title = "Happy Holiday"; print('Please Select The Story You Want to Read (1-3) :'); story_choice = int(input()); story2_title = "Registering For Success" story3_title = "Ted The Turkey" if story_choice == 1 : print('Story 1: '); print(story1_title.title()); print('Name'); story1_name = input(); print('Age'); story1_age = input(); print('Which holiday'); story1_holiday = input(); print('Favorite'); story1_favorite = input() print("") print(f"Hi I am {story1_name}, and I am {story1_age} years old. I love {story1_holiday}, it is a great holiday I love it so so much my family loves it too and I love the {story1_favorite}, so so much too and I don’t write much so I am done now bye bye") elif story_choice == 2 : print('Story 2: '); print(story2_title.title()); print('Name') story2_name = input() print('State Name') story2_state = input() print('Number') story2_number = input() print('Adjective') story2_adjective = input() print('Season') story2_season = input() print('Date') story2_date = input() print('Time') story2_time = input() print('Letter') story2_letter = input() print('Noun') story2_noun2 = input() print("") print(f"Two weeks before {story2_name}’s class registration day at {story2_state} State University, she spent {story2_number} hours researching teachers and courses and making the {story2_adjective} schedule for her {story2_season} semester. On Monday, {story2_date} , at exactly {story2_time}, {story2_name} logged on to register. She typed in the first class: registered. She typed in the second class: registered. The third class: class full. The fourth class: class not found. {story2_name} wished she had spent time making a plan {story2_letter}, . Oh well. Maybe she could finally try Floral Arranging for {story2_noun2}") else : print('Story 3: '); print(story3_title.title()); print('Name') story3_name = input() print('Animal') story3_animal = input() print('Holiday') story3_holiday = input() print('Animal') story3_animal2 = input() print('Object') story3_object = input() print('Noun') story3_noun = input() print('Verb') story3_verb = input() print("") print(f"Hello, my name is {story3_name} the, {story3_animal}, . I have a problem. It’s almost {story3_holiday} , so hunters are hunting, butchers are butchering, and people are eating, {story3_animal2}! I need a place to hide. Here’s a {story3_object} to hide in. Shhhhhhhhhhh! Don’t talk, someone is coming. Soon a little {story3_noun} walked past {story3_name} and said, “Do you need a place to hide?” But {story3_name} did not understand him, so {story3_name} ran as fast as he could and survived {story3_holiday}")
0
10/12 - Class 5 HW + Resources
In Introduction to Python
jliu.mky
Oct 20, 2021
story1_title = "Happy Holiday"; story1_content_1 = "Hi I am" story1_content_2 = "and I am" story1_content_3 = "years old i love" story1_content_4 = "it is a great holiday I love it so so much my family loves it too and I love the" story1_content_5 = "so so much too and I don’t write much so I am done now bye bye" print('Please Select The Story You Want to Read (1-3) :'); story_choice = int(input()); story2_title = "Registering For Success" story2_content_1 = "Two weeks before " story2_content_2 = "’s class registration day at" story2_content_3 = "State University, she spent" story2_content_4 = "hours researching teachers and courses and making the" story2_content_5 = "schedule for her" story2_content_6 = "semester. On Monday," story2_content_7 = ", at exactly" story2_content_8 = ", Tasha logged on to register. She typed in the first class: registered. She typed in the second class: registered. The third class: class full. The fourth class: class not found. Tasha wished she had spent time making a plan" story2_content_9 = ". Oh well. Maybe she could finally try Floral Arranging for" story3_title = "Ted The Turkey" story3_content = "Hello, my name is" story3_content2 = "the" story3_content3 = ". I have a problem. It’s almost" story3_content4 = ", so hunters are hunting, butchers are butchering, and people are eating" story3_content5 = "! I need a place to hide. Here’s a" story3_content6 = "to hide in. Shhhhhhhhhhh! Don’t talk, someone is coming. Soon a little" story3_content7 = " walked past Ted and said, “Do you need a place to hide?” But Ted did not understand him, so Ted ran as fast as he could and survived" if story_choice == 1 : print('Story 1: '); print(story1_title.title()); print('Name'); story1_name = input(); print('Age'); story1_age = input(); print('Which holiday'); story1_holiday = input(); print('Favorite'); story1_favorite = input() print("") print(story1_content_1, story1_name, story1_content_2, story1_age, story1_content_3, story1_holiday, story1_content_4, story1_favorite, story1_content_5) elif story_choice == 2 : print('Story 2: '); print(story2_title.title()); print('Name') story2_name = input() print('State Name') story2_state = input() print('Number') story2_number = input() print('Adjective') story2_adjective = input() print('Season') story2_season = input() print('Date') story2_date = input() print('Time') story2_time = input() print('Letter') story2_letter = input() print('Noun') story2_noun2 = input() print("") print(story2_content_1, story2_name, story2_content_2, story2_state, story2_content_3, story2_number, story2_content_4, story2_adjective, story2_content_5, story2_season, story2_content_6, story2_date, story2_content_7, story2_time, story2_content_8, story2_letter, story2_content_9, story2_noun2) else : print('Story 3: '); print(story3_title.title()); print('Name') story3_name = input() print('Animal') story3_animal = input() print('Holiday') story3_holiday = input() print('Animal') story3_animal2 = input() print('Object') story3_object = input() print('Noun') story3_noun = input() print('Verb') story3_verb = input() print('Holiday') story3_holiday2 = input() print("") print(story3_content, story3_name, story3_content2, story3_animal, story3_content3, story3_holiday, story3_content4, story3_animal2, story3_content5, story3_object, story3_content6, story3_noun, story3_content7, story3_verb,story3_holiday2)
0
2
6/21 Homework: Bit-string flicking
In CS Fundamentals for ACSL
6/21 Homework: Bit-string flicking
In CS Fundamentals for ACSL
jliu.mky
Jun 23, 2021
10101, 11100, 01101
0
0
9/21 Homework: Computer Number Systems 2
In CS Fundamentals for ACSL
6/13 Homework: Computer Number Systems 1
In CS Fundamentals for ACSL

jliu.mky

More actions
bottom of page