From 328d5b54a9d4e7735b6b0717908d1733a3f36287 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Mon, 4 Dec 2023 18:47:21 +0000 Subject: [PATCH 1/8] Week one and two challenges --- Week-1/Week-1.md | 4 ++++ Week-1/firstpro.py | 14 ++++++++++++++ Week-1/mathquiz.py | 19 +++++++++++++++++++ Week-2/mathquiz.py | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+) create mode 100644 Week-1/Week-1.md create mode 100644 Week-1/firstpro.py create mode 100644 Week-1/mathquiz.py create mode 100644 Week-2/mathquiz.py diff --git a/Week-1/Week-1.md b/Week-1/Week-1.md new file mode 100644 index 0000000..b3eb684 --- /dev/null +++ b/Week-1/Week-1.md @@ -0,0 +1,4 @@ +## What happens when you put an expression on a line without a print command in a python script? +### As mentioned earlier on print command are use to display information when a python program is being written in a script file. No it will not print. +## What does putting a comma at the end of a print command do? In python putting comma keep string on the same line without creating a newline. +## What does putting a print command on a line by itself doe? In python print statment are intended to print out information on the screen so having a print statement without an expression the print statement will display a empty or blank output. diff --git a/Week-1/firstpro.py b/Week-1/firstpro.py new file mode 100644 index 0000000..2fdb3c6 --- /dev/null +++ b/Week-1/firstpro.py @@ -0,0 +1,14 @@ +print("Experiment 1: ") +1 + 8 +print(1 + 2) +"How come this did not print?" +print("but this did?") +print() +print() + +print("Experiment 2:") +for number in 2, 4, 6: + print(2 * number) + +for number in 2, 4, 6: + print(3 * number, end="") diff --git a/Week-1/mathquiz.py b/Week-1/mathquiz.py new file mode 100644 index 0000000..d7e8f2c --- /dev/null +++ b/Week-1/mathquiz.py @@ -0,0 +1,19 @@ + +from random import randint + +#Challenges3 +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"What is {number_one} time {number_two} ?\n")) +if (number_one * number_two == answer): + print("correct") +else: + print("wrong") + +#Challenge 4 +number_one = randint(1,10) +for number in range(number_one): + if number >= 5: + print(number) + + diff --git a/Week-2/mathquiz.py b/Week-2/mathquiz.py new file mode 100644 index 0000000..b4c4e45 --- /dev/null +++ b/Week-2/mathquiz.py @@ -0,0 +1,40 @@ +from random import randint +#Challenge1 + +number_one = randint(1,10) +number_two = randint(1,10) +print(f"Challenge one\nWhat is {number_one} times {number_two}") +answer = number_one * number_two +print(answer) + +#Challenge2 +number_one = randint(1,10) +number_two = randint(1,10) +print(f"Challenge two\nWhat is {number_one} plus {number_two}") + +result = number_one + number_two +print(result) + + +#Challenges3 + +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"Challenge three\nWhat is {number_one} times {number_two} ?\n")) + + +#Challenge4 +number_one = randint (1,10) +print(str(number_one) * 5) + +#Challenges5 + +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"Challenge five\nWhat is {number_one} times {number_two} ?\n")) +if number_one * number_two == answer: + print(f"Your answer {answer} is correct!!") +else: + print(f"Wrong") + + -- 2.39.2 From 89bc2a5aa1e93375159f381accac5aa0b1145465 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Mon, 4 Dec 2023 21:33:17 +0000 Subject: [PATCH 2/8] challenge5 to 8 --- Week-2/mathquiz.py | 24 ++++++++++++++++++++++++ Week-2/mathquiz/challenge5.py | 10 ++++++++++ Week-2/mathquiz/challenge6.py | 5 +++++ Week-2/mathquiz/challenge7.py | 5 +++++ Week-2/mathquiz/challenge8.py | 10 ++++++++++ 5 files changed, 54 insertions(+) create mode 100644 Week-2/mathquiz/challenge5.py create mode 100644 Week-2/mathquiz/challenge6.py create mode 100644 Week-2/mathquiz/challenge7.py create mode 100644 Week-2/mathquiz/challenge8.py diff --git a/Week-2/mathquiz.py b/Week-2/mathquiz.py index b4c4e45..775cf29 100644 --- a/Week-2/mathquiz.py +++ b/Week-2/mathquiz.py @@ -38,3 +38,27 @@ else: print(f"Wrong") + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Week-2/mathquiz/challenge5.py b/Week-2/mathquiz/challenge5.py new file mode 100644 index 0000000..939ea7e --- /dev/null +++ b/Week-2/mathquiz/challenge5.py @@ -0,0 +1,10 @@ +from random import randint +#Challenges5 + +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"What is {number_one} times {number_two} ?\n" * 2)) +if number_one * number_two == answer: + print(f"Your answer {answer} is correct!!") +else: + print(f"Wrong the correct answer is {number_one * number_two}") diff --git a/Week-2/mathquiz/challenge6.py b/Week-2/mathquiz/challenge6.py new file mode 100644 index 0000000..a35e06d --- /dev/null +++ b/Week-2/mathquiz/challenge6.py @@ -0,0 +1,5 @@ +userInput = int(input("Enter a valid number :")) +if userInput > 100: + print(" Great number ") + + diff --git a/Week-2/mathquiz/challenge7.py b/Week-2/mathquiz/challenge7.py new file mode 100644 index 0000000..e18399d --- /dev/null +++ b/Week-2/mathquiz/challenge7.py @@ -0,0 +1,5 @@ +userInput = int(input("Enter a valid number :")) +if userInput == 100: + print(" Tie ") + + diff --git a/Week-2/mathquiz/challenge8.py b/Week-2/mathquiz/challenge8.py new file mode 100644 index 0000000..9e52f6c --- /dev/null +++ b/Week-2/mathquiz/challenge8.py @@ -0,0 +1,10 @@ +from random import randint +#Challenges5 + +number_one = randint(1,10) +number_two = randint(1,10) +answer = int(input(f"What is {number_one} times {number_two} ?\n")) +if number_one * number_two == answer: + print("yes") +else: + print("No!!") -- 2.39.2 From b2a0114b3272a7ba65666a80ccf1b24408f0640d Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Tue, 5 Dec 2023 06:42:33 +0000 Subject: [PATCH 3/8] Challenges 9 --- Week-2/mathquiz/challenge9.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Week-2/mathquiz/challenge9.py diff --git a/Week-2/mathquiz/challenge9.py b/Week-2/mathquiz/challenge9.py new file mode 100644 index 0000000..b73e978 --- /dev/null +++ b/Week-2/mathquiz/challenge9.py @@ -0,0 +1,12 @@ +from random import randint +#Challenge 9 + +win1 = randint(1,10) +win2 = randint(11,20) +win3 = randint(21,30) + +winners = str(win1) + " " + str(win2) + " " + str(win3) +print(winners) +for winner in winners: + print(winner) + -- 2.39.2 From 9a652fb56cf14add6c77f25c70e92861531c3566 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Thu, 7 Dec 2023 22:36:11 +0000 Subject: [PATCH 4/8] pretty pictures challenges --- Week-3/Pretty-picture/Challenges1.py | 18 ++++++++++++++++++ Week-3/Pretty-picture/Challenges3-4.py | 12 ++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 Week-3/Pretty-picture/Challenges1.py create mode 100644 Week-3/Pretty-picture/Challenges3-4.py diff --git a/Week-3/Pretty-picture/Challenges1.py b/Week-3/Pretty-picture/Challenges1.py new file mode 100644 index 0000000..aeb251b --- /dev/null +++ b/Week-3/Pretty-picture/Challenges1.py @@ -0,0 +1,18 @@ +from gasp import * +#The below link will give you a total understanding of Coordinate Plan +# https://www.splashlearn.com/math-vocabulary/geometry/coordinates + +begin_graphics() + +Circle((350,255),100)#This cirecle represent head +Circle((300,255), 20) #This circle represent left eye +Circle((370,260),20) #This circle represent left eye + + + + + + +update_when("key_pressed") + +end_graphics() diff --git a/Week-3/Pretty-picture/Challenges3-4.py b/Week-3/Pretty-picture/Challenges3-4.py new file mode 100644 index 0000000..7206f6c --- /dev/null +++ b/Week-3/Pretty-picture/Challenges3-4.py @@ -0,0 +1,12 @@ +#Challenges 3 +def moan(): + print("\nPython is useless!\nAnd so are these worksheets") + +moan() + +# Challenge 4 + +def twice(x): + print(x*x) + +twice(5) -- 2.39.2 From 3f526a369d5ab738f83c594c267aa8b9e04682ea Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Fri, 8 Dec 2023 08:46:12 +0000 Subject: [PATCH 5/8] modify Challenges3-4 --- Week-3/Pretty-picture/Challenges3-4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week-3/Pretty-picture/Challenges3-4.py b/Week-3/Pretty-picture/Challenges3-4.py index 7206f6c..73a9583 100644 --- a/Week-3/Pretty-picture/Challenges3-4.py +++ b/Week-3/Pretty-picture/Challenges3-4.py @@ -1,6 +1,6 @@ #Challenges 3 def moan(): - print("\nPython is useless!\nAnd so are these worksheets") + print("\nPython is useless!\n\nAnd so are these worksheets\n") moan() -- 2.39.2 From c2a14da00c87105f27759369d58f4f75e654b6f9 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Fri, 8 Dec 2023 09:57:16 +0000 Subject: [PATCH 6/8] Pretty picture challenge one explanation --- Week-3/Pretty-picture/Questions.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Week-3/Pretty-picture/Questions.md diff --git a/Week-3/Pretty-picture/Questions.md b/Week-3/Pretty-picture/Questions.md new file mode 100644 index 0000000..82cccaa --- /dev/null +++ b/Week-3/Pretty-picture/Questions.md @@ -0,0 +1,4 @@ +#Challenges1 Question +

According to your instruction or recommendation for one to understand coordinator and draw picture/pixel in python you need to understand the coordinate plan which happened to be the x and y axis. So yesterday I search this site https://www.splashlearn.com/math-vocabulary/geometry/coordinates and understand that the coordinate have four quadrants. quadrant i(+,+) quadrantii(-,+) quadrant iii (-,-) and quadrant iv(+,-) and origin is at the center (0). Forward more when a value like this Circle((350,255),100) which has three value. The first value 350 represent positive x, the second value represent positive y while the last value tell you how big the circle will be on a coordinate. My second Circle that represent the eye have similar step. first value represent the eye.Circle((x=300,y255), "how big the first eye is 20) #This circle represent left eye and it is situated in the first quadrant i(+,+)

and same for the second eye in my code.Now my response to drawing a nose will come after I under this https://www.splashlearn.com/math-vocabulary/geometry/line. + +Hope this find you well. \ No newline at end of file -- 2.39.2 From a4afb410ece0d3bf514aa4f0202fa1ade44243ae Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Thu, 14 Dec 2023 09:29:45 +0000 Subject: [PATCH 7/8] Pretty face --- Week-3/Pretty-picture/Challenges1.py | 12 +++++------- Week-3/Pretty-picture/Challenges2.py | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 Week-3/Pretty-picture/Challenges2.py diff --git a/Week-3/Pretty-picture/Challenges1.py b/Week-3/Pretty-picture/Challenges1.py index aeb251b..f6eb7a6 100644 --- a/Week-3/Pretty-picture/Challenges1.py +++ b/Week-3/Pretty-picture/Challenges1.py @@ -4,14 +4,12 @@ from gasp import * begin_graphics() -Circle((350,255),100)#This cirecle represent head -Circle((300,255), 20) #This circle represent left eye -Circle((370,260),20) #This circle represent left eye - - - - +Circle((300, 350), 90)#This cirecle represent head +Circle((350, 370), 15) #This circle represent left eye +Circle((250, 370), 15) #This circle represent left eye +Arc((300, 350), 40, 225, 330) +Line((300, 400), (230, 250)) update_when("key_pressed") diff --git a/Week-3/Pretty-picture/Challenges2.py b/Week-3/Pretty-picture/Challenges2.py new file mode 100644 index 0000000..7dff8c1 --- /dev/null +++ b/Week-3/Pretty-picture/Challenges2.py @@ -0,0 +1,20 @@ +from gasp import * +begin_graphics() + + +Circle((300, 200), 100) +Circle((240, 240), 15) +Circle((360, 240), 15) +Line((500, 300), (400,220)) +Line((380, 260), (330,260)) +Line((270, 260), (220,260)) +Line((300, 260), (270, 200)) +Line((300, 260), (340, 200)) +Line((340, 200), (270, 200)) +Arc((300, 190), 40, 225, 315) +Arc((420, 220), 30, 235, 510) +Arc((200, 220), 30, 60, 630) + + +update_when('key_passed') +end_graphics() -- 2.39.2 From 3378d950da71c176a931f25d60c068b6a91aca44 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Thu, 14 Dec 2023 09:38:23 +0000 Subject: [PATCH 8/8] Question from the drawing --- Week-3/Pretty-picture/Questionfromdrawing.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Week-3/Pretty-picture/Questionfromdrawing.md diff --git a/Week-3/Pretty-picture/Questionfromdrawing.md b/Week-3/Pretty-picture/Questionfromdrawing.md new file mode 100644 index 0000000..4ee99b1 --- /dev/null +++ b/Week-3/Pretty-picture/Questionfromdrawing.md @@ -0,0 +1,6 @@ +Question +Base on your instruction in the lesson to draw a face with the following: +head, eyes, nose and mouth +I tried doing so but got lose on the line. can you please explain what these +value represent in a (Line((300, 400), (230, 250))? Example for a Circle value (x=350,y=370) and 15 is equal to how big you +want the circle to be... -- 2.39.2