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..775cf29 --- /dev/null +++ b/Week-2/mathquiz.py @@ -0,0 +1,64 @@ +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") + + + + + + + + + + + + + + + + + + + + + + + + + + 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!!") 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) + diff --git a/Week-3/Pretty-picture/Challenges1.py b/Week-3/Pretty-picture/Challenges1.py new file mode 100644 index 0000000..f6eb7a6 --- /dev/null +++ b/Week-3/Pretty-picture/Challenges1.py @@ -0,0 +1,16 @@ +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((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") + +end_graphics() 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() diff --git a/Week-3/Pretty-picture/Challenges3-4.py b/Week-3/Pretty-picture/Challenges3-4.py new file mode 100644 index 0000000..73a9583 --- /dev/null +++ b/Week-3/Pretty-picture/Challenges3-4.py @@ -0,0 +1,12 @@ +#Challenges 3 +def moan(): + print("\nPython is useless!\n\nAnd so are these worksheets\n") + +moan() + +# Challenge 4 + +def twice(x): + print(x*x) + +twice(5) 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... 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