├── readme.md ├── Unit 2 ├── Unit_2_Lesson.py ├── Unit_2_Exercises.py └── Unit_2_Vocabulary.md ├── Unit 3 ├── Unit_3_Lesson.py ├── Unit_3_Exercises.py └── Unit_3_Vocabulary.md ├── Unit 4 ├── Unit_4_Lesson.py ├── Unit_4_Exercises.py ├── unit4_Vocabulary.md └── PreThanksgivingWork │ ├── extraCredit.py │ ├── rps p2.py │ └── rps p3.py ├── Unit 5 ├── Unit_5_Exercises.py ├── Unit_5_Lessons.py └── Unit5_Vocabulary.md ├── _AI_Unit ├── AI_Unit_Lesson.py ├── AI_Unit_Exercises.py └── AI_Unit_Vocabulary.md ├── .gitignore ├── .vscode └── settings.json ├── Resources ├── SDLC Reference Sheet.png └── Python Basics Reference Sheet.png ├── Unit 1 ├── Unit_1_Vocabulary.md ├── Unit_1_Exercises.py └── Unit_1_Lesson.py └── miniProjects ├── minProject2_solution_p2.py ├── minProject2_solution_p1.py ├── miniProject_solution_p3.py ├── miniProject1_solution_p1.py ├── miniProject1_solution_p2.py └── miniProject1_solution_p3.py /readme.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 2/Unit_2_Lesson.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 3/Unit_3_Lesson.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 4/Unit_4_Lesson.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 2/Unit_2_Exercises.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 3/Unit_3_Exercises.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 4/Unit_4_Exercises.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 5/Unit_5_Exercises.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Unit 5/Unit_5_Lessons.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_AI_Unit/AI_Unit_Lesson.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_AI_Unit/AI_Unit_Exercises.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Instructor_Notes 2 | Assessments 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "liveServer.settings.port": 5501 3 | } -------------------------------------------------------------------------------- /Unit 4/unit4_Vocabulary.md: -------------------------------------------------------------------------------- 1 | 1. List 2 | 3 | 2. For Loop 4 | 5 | 3. While Loop 6 | 7 | -------------------------------------------------------------------------------- /Resources/SDLC Reference Sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Iankimble/Coding/HEAD/Resources/SDLC Reference Sheet.png -------------------------------------------------------------------------------- /Resources/Python Basics Reference Sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Iankimble/Coding/HEAD/Resources/Python Basics Reference Sheet.png -------------------------------------------------------------------------------- /Unit 3/Unit_3_Vocabulary.md: -------------------------------------------------------------------------------- 1 | 1. Conditional Statment 2 | 3 | 2. Nested Conditional Statment 4 | 5 | 3. Range() 6 | 7 | 4. Append() 8 | 9 | 5. Remove() 10 | 11 | 4. Random() 12 | 13 | -------------------------------------------------------------------------------- /Unit 5/Unit5_Vocabulary.md: -------------------------------------------------------------------------------- 1 | 1. Software Development Life Cycle 2 | 3 | 2. Sprint 4 | 5 | 3. Agile 6 | 7 | 4. Retrospective 8 | 9 | 5. User Exeprience 10 | 11 | 6. User Interface 12 | 13 | 7. Software Engineer 14 | 15 | 8. Software Architect 16 | 17 | -------------------------------------------------------------------------------- /Unit 2/Unit_2_Vocabulary.md: -------------------------------------------------------------------------------- 1 | 1. User- Defined Functions 2 | 3 | 2. Function Parameter 4 | 5 | 3. Function Argument 6 | 7 | 4. Error Handling 8 | 9 | 5. Arithmetic Error 10 | 11 | 6. Identation Error 12 | 13 | 7. Syntax Error 14 | 15 | 8. Syntax Error 16 | 17 | 9. Type Error 18 | -------------------------------------------------------------------------------- /_AI_Unit/AI_Unit_Vocabulary.md: -------------------------------------------------------------------------------- 1 | 1. Artificial Intelligence (AI) 2 | 3 | 2. Artificial General Intelligence (AGI) 4 | 5 | 3. Generative AI 6 | 7 | 4. LLM 8 | 9 | 5. Prompting 10 | 11 | 6. Hallucination 12 | 13 | 7. Model 14 | 15 | 8. Token 16 | 17 | 9. Algorithm 18 | 19 | 10. Training Data 20 | 21 | 11. Agent 22 | 23 | -------------------------------------------------------------------------------- /Unit 1/Unit_1_Vocabulary.md: -------------------------------------------------------------------------------- 1 | Unit 1 Vocabulary 2 | 3 | 1. Syntax 4 | 5 | 2. Data type 6 | 7 | 3. Comments 8 | 9 | 4. String Data ype 10 | 11 | 5. Integer Data type 12 | 13 | 6. Float Data type 14 | 15 | 7. Boolean Data type 16 | 17 | 8. Built-in Functions 18 | 19 | 9. String concatenation 20 | 21 | 10. Input Functions 22 | 23 | 11. Print Function 24 | 25 | -------------------------------------------------------------------------------- /Unit 1/Unit_1_Exercises.py: -------------------------------------------------------------------------------- 1 | # Python Sytnax Exercises 2 | 3 | # Have seperate slide and have students submit their answers via github 4 | 5 | # In your own words describe what is a variable 6 | 7 | # In your own words, describe what syntax is 8 | 9 | # Name 2 data types 10 | 11 | # Can you identify the difference between the 3 variable naming conventions 12 | example_One= '' 13 | ExampleOne = '' 14 | example1 = '' 15 | 16 | -------------------------------------------------------------------------------- /Unit 1/Unit_1_Lesson.py: -------------------------------------------------------------------------------- 1 | # Using Codespace 2 | # --> Explorer - Documents and Files 3 | # --> Source control 4 | # --> Extensions 5 | 6 | # Pyton Programming 7 | # --> Definition and usecases 8 | 9 | # Python Syntax 10 | # --> Syntax rules 11 | 12 | # Python Data types 13 | # --> Example 1 Boolean 14 | # --> Example 2 String 15 | # --> Example 3 Integer 16 | # --> Example 4 Float 17 | 18 | # Python Variables 19 | # --> Variable nameing conventions 20 | 21 | # Python Builtin Functions 22 | # --> Print() 23 | # --> Input() 24 | # --> String Concatenation 25 | 26 | # Python Operators 27 | # --> Arithmetic 28 | # --> Logical 29 | # --> Comparison 30 | # --> Assignment 31 | 32 | # DataCasting 33 | # --> Float() 34 | # --> Str() 35 | # --> Int() 36 | # --> Bool() 37 | 38 | -------------------------------------------------------------------------------- /miniProjects/minProject2_solution_p2.py: -------------------------------------------------------------------------------- 1 | # need to have function take in a subject 2 | # need the function to take in 17 numbers - 1 for each week 3 | # need to add up all 17 numbers and then divide by 17 4 | # need to turn the number grade into a letter grade and show the use both 5 | 6 | def gpaCalculator(): 7 | subject= input('What subject is this GPA for? ') 8 | print('The subject the user typed is :' + subject) 9 | 10 | finalSum = 0 11 | weekCount = 1 12 | while weekCount != 10: 13 | print('what is the grade for week ' + str(weekCount)) 14 | grade = int(input()) 15 | # grade=('you enterd: '+ grade) 16 | finalSum += grade 17 | print(finalSum) 18 | weekCount += 1 19 | 20 | finalGPA = finalSum/ 10 21 | print('Your GPA is: '+ str(finalGPA)) 22 | if finalGPA > 70 and finalGPA <80: 23 | print('C') 24 | elif finalGPA >80 and finalGPA <90: 25 | print('B') 26 | elif finalGPA > 90 and finalGPA < 100: 27 | print('A') 28 | 29 | gpaCalculator() -------------------------------------------------------------------------------- /miniProjects/minProject2_solution_p1.py: -------------------------------------------------------------------------------- 1 | # GPA calculator 2 | # 1. need to take in user input for subject- can be any school subject 3 | # 2. need to take in a grade 17 times. each grade representing each week in the 4 | # semester. 5 | # 3. once I have all 17 grades, I need to add them up, and then divide by 17 6 | # 4. once I have the number grade, I need to write some code to transform 7 | # it into a letter grade 8 | 9 | def gpaCalculator(): 10 | print(' What subject is this GPA for? ') 11 | subject = input() 12 | print("the user entered: "+ subject) 13 | week = 1 14 | sum = 0 15 | while week != 10: 16 | print('Please enter the grade for week : '+ str(week)) 17 | grade = int(input()) 18 | sum += grade 19 | week += 1 20 | gpa = sum / 10 21 | if gpa > 70 and gpa < 80: 22 | print('C') 23 | elif gpa > 80 and gpa < 90: 24 | print('B') 25 | elif gpa > 90 and gpa <100: 26 | print('A') 27 | else: 28 | print('F') 29 | print('your gpa for '+ subject + ' is ' + str(gpa)) 30 | 31 | gpaCalculator() -------------------------------------------------------------------------------- /Unit 4/PreThanksgivingWork/extraCredit.py: -------------------------------------------------------------------------------- 1 | # Create a new document called ThanksgivingExtraCredit.py and complete the following questions: 2 | 3 | # 1 . create a function that will determine a persons letter grade based on the number entered. 4 | # for example: 98 = A, 79 = C, 60 = F 5 | # you can use input or a a parameter to pass in your numbers 6 | 7 | # 2. Create a function that will convert kilograms into pounds. 8 | # hint = 1 kg is rouglhy 2.2 lbs 9 | # you can use input or a a parameter to pass in your numbers 10 | 11 | # 3. Create a function that will go through the list of school items and removes the following banned 12 | # items for the students backpacks. 13 | # Your function should print out the new revised list with the banned items removed 14 | 15 | # Banned items/ items to be removed = gum, soda, snacks 16 | 17 | # lists 18 | Carlos_backPack= ['books', 'pencils','pens','soda','laptop'] 19 | Edwards_backPack = ['gum','soda','laptop','notebook'] 20 | # what should be printed out after passing list in function : [laptop, notebook] 21 | # soda and gum are removed 22 | Brittanys_backPack = ['snacks', 'binder','pens','notebook','soda'] 23 | 24 | -------------------------------------------------------------------------------- /miniProjects/miniProject_solution_p3.py: -------------------------------------------------------------------------------- 1 | # GPA calculator 2 | # 1. function needs to take in a subject for the GPA - math, history, etc 3 | # 2. function needs to take in a grade 17 times - 1 grade for each of the 17 weeks 4 | # 3. function needs to add all the grades up and divide by 17 5 | # 4. function needs to tell the user the letter grade based on number 6 | # 70-80 = c 7 | # 80-90 = b 8 | # 90-100 = a 9 | 10 | def gpaCalculator(): 11 | print('What subject is this GPA for? ') 12 | subject= input() 13 | print('the user typed in: ' + subject) 14 | 15 | sum= 0 16 | weekcount= 1 17 | while weekcount != 6: 18 | print('what is the grade for week '+ str(weekcount)) 19 | grade = int(input()) 20 | # print('the user entered: '+ str(grade)) 21 | sum += grade 22 | # print('total sum = ' + str(sum)) 23 | weekcount += 1 24 | gpa = sum / weekcount 25 | print('your gpa is :' + str(gpa)) 26 | if gpa > 70 and gpa <80: 27 | print("C") 28 | elif gpa > 80 and gpa<90: 29 | print("B") 30 | elif gpa > 90 and gpa < 100: 31 | print("A") 32 | gpaCalculator() 33 | 34 | 35 | 36 | # wk1 = int(input("please type the grade for week 1: ")) 37 | # wk2 = int(input("please type the grade for week 2: ")) 38 | # wk3 = int(input("please type the grade for week 3: ")) 39 | # wk4 = int(input("please type the grade for week 4: ")) 40 | # sum = wk1 +wk2+ wk3+ wk4 41 | # gpa = sum/4 42 | # print(sum) 43 | # print(gpa) -------------------------------------------------------------------------------- /miniProjects/miniProject1_solution_p1.py: -------------------------------------------------------------------------------- 1 | def python_Quiz(): 2 | score = 0 3 | print("1. Which of the following is NOT a data type? ") 4 | print("A. Integer") 5 | print("B. Function") 6 | print("C. String") 7 | userAnswer = input() 8 | # print('this is what the user enter: ' + userAnswer) 9 | correctAnswer = "b" 10 | if userAnswer == correctAnswer: 11 | print('correct') 12 | score +=1 13 | else: 14 | print("incorrect") 15 | print("2. Which best describes a function parameter? ") 16 | print("A. It is data that is used in a function") 17 | print("B. It is placeholder data used in a function definition") 18 | print("C. It is real data used in a function invocation") 19 | userAnswer = input() 20 | # print('this is what the user enter: ' + userAnswer) 21 | correctAnswer = "b" 22 | if userAnswer == correctAnswer: 23 | print('correct') 24 | score +=1 25 | else: 26 | print("incorrect") 27 | print("3. Which of the following is NOT a data type? ") 28 | print("A. Integer") 29 | print("B. Function") 30 | print("C. String") 31 | userAnswer = input() 32 | # print('this is what the user enter: ' + userAnswer) 33 | correctAnswer = "b" 34 | if userAnswer == correctAnswer: 35 | print('correct') 36 | score +=1 37 | else: 38 | print("incorrect") 39 | print("4. Which of the following is NOT a data type? ") 40 | print("A. Integer") 41 | print("B. Function") 42 | print("C. String") 43 | userAnswer = input() 44 | # print('this is what the user enter: ' + userAnswer) 45 | correctAnswer = "b" 46 | if userAnswer == correctAnswer: 47 | print('correct') 48 | score +=1 49 | else: 50 | print("incorrect") 51 | print("5. Which of the following is NOT a data type? ") 52 | print("A. Integer") 53 | print("B. Function") 54 | print("C. String") 55 | userAnswer = input() 56 | # print('this is what the user enter: ' + userAnswer) 57 | correctAnswer = "b" 58 | if userAnswer == correctAnswer: 59 | print('correct') 60 | score +=1 61 | else: 62 | print("incorrect") 63 | 64 | print('Here is youur score: ' + str(score) + ' /5') 65 | -------------------------------------------------------------------------------- /miniProjects/miniProject1_solution_p2.py: -------------------------------------------------------------------------------- 1 | # create a quiz game that gives users options. 2 | # users type in a letter/ number that represent the answer 3 | # keep track of answers and show them the total at the end 4 | 5 | def pythonQuiz(): 6 | grade = 0 7 | print('1. Which of the following is not a data type? ') 8 | print("A. Function") 9 | print('B. Integer') 10 | print('C. Float') 11 | print('D. String') 12 | userAnswer = input('') 13 | correctAnswer = 'a' 14 | if userAnswer == correctAnswer: 15 | grade += 1 16 | print('Correct') 17 | else: 18 | print('Incorrect') 19 | 20 | print('2. what is a function parameter? ') 21 | print("A. a variable that uses data") 22 | print('B. a peice of code that does operations') 23 | print('C. a peice of data that is a placeholder for data') 24 | print('D. real data that is worked on in a function') 25 | userAnswer = input('') 26 | correctAnswer = 'c' 27 | if userAnswer == correctAnswer: 28 | grade += 1 29 | print('Correct') 30 | else: 31 | print('Incorrect') 32 | 33 | print('3. What is a for loop? ') 34 | print("A. a type of function that repeats code forever") 35 | print('B. a type of function that checks conditions') 36 | print('C. a type of function that repeats 3 times') 37 | print('D. a type of function that repeats a finite amount of times') 38 | userAnswer = input('') 39 | correctAnswer = 'd' 40 | if userAnswer == correctAnswer: 41 | grade +=1 42 | print('Correct') 43 | else: 44 | print('Incorrect') 45 | print('4. True or false, a 0 and 1 can be considered booleans? ') 46 | print("A. True") 47 | print('B. False') 48 | userAnswer = input('') 49 | correctAnswer = 'a' 50 | if userAnswer == correctAnswer: 51 | grade +=1 52 | print('Correct') 53 | else: 54 | print('Incorrect') 55 | 56 | print('5. what is a function invocation? ') 57 | print("A. it is when we write the function instructions") 58 | print('B. it is when we use conditionals in a function') 59 | print('C. it is when we invoke and call a function') 60 | print('D. it is none of the above') 61 | userAnswer = input('') 62 | correctAnswer = 'a' 63 | if userAnswer == correctAnswer: 64 | grade +=1 65 | print('Correct') 66 | else: 67 | print('Incorrect') 68 | 69 | print('6. which these is a python operator? ') 70 | print("A. assignment") 71 | print('B. list') 72 | print('C. boolean') 73 | print('D. casting') 74 | userAnswer = input() 75 | correctAnswer = 'a' 76 | if userAnswer == correctAnswer: 77 | grade +=1 78 | print('Correct') 79 | else: 80 | print('Incorrect') 81 | 82 | print('7. What does thee pthon float() function do? ') 83 | print("A. Changes a number data type into a decimal number") 84 | print('B. Returns a sequence of numbers starting from 0, increments by 1') 85 | print('C. Prints specified messagee to screen') 86 | userAnswer = input() 87 | correctAnswer = 'a' 88 | if userAnswer == correctAnswer: 89 | grade +=1 90 | print('Correct') 91 | else: 92 | print('Incorrect') 93 | 94 | print('8. Which symbbols / characters represent true and false? ') 95 | print("A. and, not") 96 | print('B. !=', '==') 97 | print("C. 0, 100") 98 | print("D. True and False") 99 | userAnswer = input() 100 | correctAnswer = 'd' 101 | if userAnswer == correctAnswer: 102 | grade +=1 103 | print('Correct') 104 | else: 105 | print('Incorrect') 106 | 107 | print('here is your final grade: '+ str(grade) + '/ 5') 108 | 109 | pythonQuiz() 110 | 111 | 112 | -------------------------------------------------------------------------------- /Unit 4/PreThanksgivingWork/rps p2.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | # Please make a new document called rps.py and Develop ideas and 4 | # analyze the requirements for a rock, paper, scissor game. 5 | 6 | # For the ideation phase, write down 3 things your rock, paper, 7 | # scissor game should be able to do 8 | 9 | "1. Users should be able to choose between rock, paper, and scissor" 10 | "depending on their selection, they can either win, lose, or tie" 11 | 12 | "2. Rounds should go up to 4, if tied go into sudden death match" 13 | 14 | "3. If a player wins, you can take away a win from the opponent" 15 | "- could add it to yours" 16 | 17 | "4. If you win 3 straight its an automatic win" 18 | 19 | 'multi-player' 20 | 'reset game option' 21 | 22 | # For the requirements and analysis phase, write down at last 4 23 | # technical requirements; example: be able to use integer data type 24 | # to process decisions. 25 | 26 | # requirements- contexualize it in programming terms 27 | # - what data types do we need 28 | # - what operators do we need 29 | # - are we using if/else 30 | # - are we using a loop 31 | 32 | '1. We could use strings to represent each option and possibly integers for ' 33 | 34 | 'the option' 35 | 'selection' 36 | "example input 1 for rock, input 2 for scissor, input 3 for paper" 37 | "'analysis = easy" 38 | 39 | '2. we can use a comparison operator to compare who won more rounds.' 40 | 'the person who won more rounds, wins.' 41 | "analysis = easy" 42 | 43 | '3. we can use a loop to keep the game going until someone wins.' 44 | "analysis = easy" 45 | 46 | '4. if function; user gets 3 wins consecutively, stop the game loop ' 47 | "analysis = medium" 48 | 49 | # design 50 | # plan for how the program will "flow"; essentially, how will users 51 | # use the program step-by-step 52 | 53 | 'Step. 1: Welcome the user to the game' 54 | 'Step. 2: Give them the option to play the game or see the game rules' 55 | 'Step. 3: if user select rules, show them the rules, else start the game' 56 | 'Step. 4: Inform the user the game has started and ask them to make a selection; R,P,S' 57 | 'Step. 5: Computer makes a random selection' 58 | 'Step. 6: determine and the user/ player if they won, lose, or tied' 59 | 'and keep track of score and round' 60 | 'Step. 7: (LOOP) Show the user the RPS options and they will continue to play up until round 4.' 61 | 'step 7.5: check if the user has won consective rounds- if they win 3 straight- give them a special message' 62 | 'Step. 8: Determine and inform the user if they won and return them to the main menu' 63 | 64 | # development 65 | 66 | def rpsGame(): 67 | rpsOptions_cpu = ["rock", "paper", "scissor"] 68 | 69 | print("Welcome to Rock Paper Scissor: the game!") 70 | print("Please select one of the following:") 71 | print('Enter p to start game,') 72 | print('Enter r to see the rules') 73 | selection = input() 74 | if selection == 'r': 75 | print("here are the game rules ...") 76 | elif selection == 'p': 77 | print('the game is starting...') 78 | choiceUser = input("please make selection, r= rock, p= paper, s= scissor") 79 | choiceCpu = random.choice(rpsOptions_cpu) 80 | # make a way to show the full selection word ; example: if s, 81 | # the program should print scissor 82 | if choiceUser == 'r': 83 | selectWord = rpsOptions_cpu[0] 84 | print('user selected: ' + selectWord) 85 | print('cpu selected: '+ choiceCpu) 86 | elif choiceUser == 'p': 87 | selectWord = 'paper' 88 | print('user selected: ' + selectWord) 89 | print('cpu selected: '+ choiceCpu) 90 | elif choiceUser == 's': 91 | selectWord = 'scissor' 92 | print('user selected: ' + selectWord) 93 | print('cpu selected: '+ choiceCpu) 94 | else: 95 | print("Sorry, we didnt understand your entry.") 96 | 97 | 98 | rpsGame() -------------------------------------------------------------------------------- /Unit 4/PreThanksgivingWork/rps p3.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | #Please make a new document called rps.py and Develop ideas and 4 | # analyze the requirements for a rock, paper, scissor game. 5 | 6 | # For the ideation phase, write down 3 things your rock, paper, 7 | # scissor game should be able to do 8 | 9 | "1. Player should be able to pick from 3 options; rock, paper, and scissors." 10 | 11 | "2. Player can player against the computer or another player." 12 | 13 | "3. program needs to be able to understand which options win, lose or tie against" 14 | "another option" 15 | 16 | "4. If two player select the same option- draw, they have to play again." 17 | "keep count of points." 18 | 19 | "5. adding power ups" 20 | 21 | # For the requirements and analysis phase, write down at last 4 22 | # technical requirements; example: be able to use integer data type 23 | # to process decisions. 24 | 25 | # requirements- contexualize it in programming terms 26 | # - what data types do we need 27 | # - what operators do we need 28 | # - are we using if/else 29 | # - are we using a loop 30 | 31 | "we need to assign some data to variables that will represent" 32 | "rock, papper, and scissor." 33 | "1" 34 | 35 | "we can use strings to represent the rock, paper, and scissor" 36 | "We can use integers to keep score." 37 | "1" 38 | 39 | "we need a conditional statement (if/else) to allow players to choose between" 40 | "playing a human and a cpu; if user types h they can play a human, else they" 41 | "will play the cpu." 42 | "2" 43 | 44 | "we need a for loop to keep the game running until someone wins." 45 | "3.5" 46 | 47 | "we can use comparion operators to determine if a selection is the same or not the same" 48 | "1" 49 | 50 | "powers ???" 51 | "5" 52 | 53 | # design - what should user be doing in our game, step-by-step 54 | '1. Show player the start screen. start screen should have title (image), new game, continue, game rules, settings, quit' 55 | '2. if the player hits start game, the player can choose between 1(cpu) or 2 players' 56 | '3. if 2 players ...' 57 | '4. if 1 player. they play the cpu' 58 | '5. inform player the game has started and to make a selection; r,p,s ' 59 | '6. after player chooses an option, cpu randomly selects an option. ' 60 | "7. determine who wins, loses,or ties, inform the user, and distribute points" 61 | "8. loop these actions 4 times. The player with the highest point wins." 62 | "9. inform the user if they won or loss, show them the final score and give them" 63 | "the option to play again or quite." 64 | 65 | # development 66 | 67 | # future dev features 68 | # loop for menu 69 | # human vs human local / coach co-op multi- player 70 | 71 | def rpsGame(): 72 | rpsOptiions = ["rock", "paper", "scissor"] 73 | print('Welcome to RPS: the Game!') 74 | print('***************************') 75 | print("Please select from the following options: ") 76 | print('1. Start Game') 77 | print('2. Game Rules') 78 | print("3. Quit") 79 | selection = input() 80 | if int(selection) == 1: 81 | print('the game is starting...') 82 | print("Please select a game mode: ") 83 | print('1. vs. human') 84 | print('2. vs. cpu') 85 | gameMode = int(input()) 86 | if gameMode == 1: 87 | print("Coming soon. sorry : / ") 88 | else: 89 | print("Game is starting!") 90 | print('***************************') 91 | print("Please make a selection:") 92 | print('1. Rock') 93 | print("2. Paper") 94 | print('3. Scissor') 95 | userSelection = input() 96 | cpuSelection = random.choice(rpsOptiions) 97 | print('user selected : ' + userSelection) 98 | # modify this code so that instead of seeing the number for the user selection we see the word 99 | # example 1 should print out rock 100 | print('cpu selected : ' + cpuSelection) 101 | 102 | elif int(selection) == 2: 103 | print('Game Rules...') 104 | elif int(selection) == 3: 105 | print("Good bye...") 106 | else: 107 | print('ERROR: Invalid selecton. Please select a listed option from the menu.') 108 | 109 | rpsGame() -------------------------------------------------------------------------------- /miniProjects/miniProject1_solution_p3.py: -------------------------------------------------------------------------------- 1 | def pythonQuiz(): 2 | grade = 0 3 | print('1. What is a function argument?') 4 | print('A. Placeholder data that goes into a function.') 5 | print('B. Real data that goes into a function.') 6 | print('C. A piece of data used to compare values.') 7 | userAnswer = input() 8 | # print('this is what the user typed : ' + userAnswer) 9 | correctAnswer = 'b' 10 | if userAnswer == correctAnswer: 11 | print("Correct") 12 | grade += 1 13 | else: 14 | print("Incorrect") 15 | 16 | print('2. True or false; 0 and 1 can be used as boolean values?') 17 | print('A. True') 18 | print('B. False') 19 | userAnswer = input() 20 | # print('this is what the user typed : ' + userAnswer) 21 | correctAnswer = 'a' 22 | if userAnswer == correctAnswer: 23 | print("Correct") 24 | grade += 1 25 | else: 26 | print("Incorrect") 27 | print('3. What is a function invocation?') 28 | print('A. It is when you write the instructions for your function') 29 | print('B. It is when you pass data into your function') 30 | print('C. It is when you call the function') 31 | userAnswer = input() 32 | # print('this is what the user typed : ' + userAnswer) 33 | correctAnswer = 'c' 34 | if userAnswer == correctAnswer: 35 | print("Correct") 36 | grade += 1 37 | else: 38 | print("Incorrect") 39 | print('4. What is the difference between an integer and a float?') 40 | print('A. An integer is a decimal number and a float is a whole number') 41 | print('B. An integer is a whole number and a float is a decimal number') 42 | print('C. There is no difference. They are both number data types') 43 | userAnswer = input() 44 | # print('this is what the user typed : ' + userAnswer) 45 | correctAnswer = 'b' 46 | if userAnswer == correctAnswer: 47 | print("Correct") 48 | grade += 1 49 | else: 50 | print("Incorrect") 51 | print('5. How many parameters can you have in a function?') 52 | print('A. 1') 53 | print('B. 2') 54 | print('C. As many as you want') 55 | userAnswer = input() 56 | # print('this is what the user typed : ' + userAnswer) 57 | correctAnswer = 'c' 58 | if userAnswer == correctAnswer: 59 | print("Correct") 60 | grade += 1 61 | else: 62 | print("Incorrect") 63 | print(" here is your score: " + str(grade) + "/ 5") 64 | 65 | print('6. Which of the following are numerical data types?') 66 | print('A. integer') 67 | print('B. boolean') 68 | print('C. list') 69 | print('D. string') 70 | userAnswer = input() 71 | # print('this is what the user typed : ' + userAnswer) 72 | correctAnswer = 'a' 73 | if userAnswer == correctAnswer: 74 | print("Correct") 75 | grade += 1 76 | else: 77 | print("Incorrect") 78 | 79 | print('7. Which data type uses quotations to wrap character together?') 80 | print('A. boolean') 81 | print('B. integer') 82 | print('C. variables') 83 | print('D. strings') 84 | userAnswer = input() 85 | # print('this is what the user typed : ' + userAnswer) 86 | correctAnswer = 'd' 87 | if userAnswer == correctAnswer: 88 | print("Correct") 89 | grade += 1 90 | else: 91 | print("Incorrect") 92 | 93 | print('8. Which of the following symbols belongs to the comparison operator family?') 94 | print('A. - ') 95 | print('B. > ') 96 | print('C. = ') 97 | print('D. * ') 98 | userAnswer = input() 99 | # print('this is what the user typed : ' + userAnswer) 100 | correctAnswer = 'b' 101 | if userAnswer == correctAnswer: 102 | print("Correct") 103 | grade += 1 104 | else: 105 | print("Incorrect") 106 | 107 | print('9. Which method can be used to remove white from the beginning and end of a string? ') 108 | print('A. pTrim() ') 109 | print('B. strip() ') 110 | print('C. len() ') 111 | print('D. trim() ') 112 | userAnswer = input() 113 | # print('this is what the user typed : ' + userAnswer) 114 | correctAnswer = 'b' 115 | if userAnswer == correctAnswer: 116 | print("Correct") 117 | grade += 1 118 | else: 119 | print("Incorrect") 120 | 121 | print(" here is your score: " + str(grade) + "/ 5") 122 | 123 | 124 | 125 | pythonQuiz() --------------------------------------------------------------------------------