Did You Know? Rock-paper-scissors is a hand game usually played by two people, where players simultaneously form one of three shapes with an outstretched hand. The “rock” beats scissors, the “scissors” beat paper and the “paper” beats rock; if both…
Did You Know? Rock-paper-scissors is a hand game usually played by two people, where players simultaneously form one of three shapes with an outstretched hand. The “rock” beats scissors, the “scissors” beat paper and the “paper” beats rock; if both…
Using all the skills we covered in the previous few challenges, we are going to adapt a script to create our own logo using Python Turtle. First let’s look at the following code: Challenge Your challenge consists of tweaking this…
Challenge #1: Leap Year? Write a program that lets the end-user enter a year using 4 digits (“yyyy” format). The program should inform the user whether the year entered is a leap year or not. Challenge #2: Valid and Invalid…
Challenge #1: Hello World! Write a program that displays the message “Hello World!” Change your program so that it asks for the end-user to type their firstname. (e.g. “John”) The program should then display “Hello John!” Challenge #2: My Name…
Learning objectives In this challenge we will use string manipulation techniques to manipulate text data. In Python a String is a piece of text. It can contain letters, numbers and punctuation signs. Hello my name is Bond, James Bond Look…
Looking at the following code can you explain the purpose of each Python Turtle instructions: myPen.color(“red”) myPen.forward(100) myPen.right(90) myPen.left(45) myPen.penup() myPen.pendown() myPen.goto(0,0) myPen.circle(50) (X,Y) Coordinates The canvas we are drawing on (using Python Turtle) is 400 pixels wide by 400…
Learning Objectives By completing this challenge we are going to learn how to define our own functions in Python. We will also assign parameters to our functions. Look at the code below used to calculate the volume of a cube.…