-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the first rock, paper, scissors session
- Loading branch information
Showing
12 changed files
with
539 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# python-bites | ||
Python Bites | ||
A collection of Python lessons / demos / examples. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Rock, Paper, Scissors | ||
|
||
Introduction to Python session based on learning a game. | ||
|
||
Session lasts for around 90 minutes. | ||
|
||
## Content | ||
- Slides for the session | ||
- Final code for Rock, Paper, Scissors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
print("Welcome to Rock, Paper, Scissors") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
print("Welcome to Rock, Paper, Scissors") | ||
|
||
user_choice = input("What is your move? (rock, paper, scissors) ") | ||
print("You picked " + user_choice) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
print("Welcome to Rock, Paper, Scissors") | ||
|
||
user_choice = input("What is your move? (rock, paper, scissors) ") | ||
print("You picked " + user_choice) | ||
|
||
if user_choice == "rock": | ||
print("You picked rock") | ||
elif user_choice == "paper": | ||
print("You picked paper") | ||
else: | ||
print("You picked scissors") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import random | ||
|
||
print("Welcome to Rock, Paper, Scissors") | ||
|
||
user_choice = input("What is your move? (rock, paper, scissors) ") | ||
computer_choice = random.choice(["rock", "paper", "scissors"]) | ||
|
||
print("You picked " + user_choice) | ||
print("The computer picked " + computer_choice) | ||
|
||
if user_choice == "rock": | ||
print("You picked rock") | ||
elif user_choice == "paper": | ||
print("You picked paper") | ||
else: | ||
print("You picked scissors") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import random | ||
|
||
print("Welcome to Rock, Paper, Scissors") | ||
|
||
user_choice = input("What is your move? (rock, paper, scissors) ") | ||
computer_choice = random.choice(["rock", "paper", "scissors"]) | ||
|
||
print("You picked " + user_choice) | ||
print("The computer picked " + computer_choice) | ||
|
||
if user_choice == "rock": | ||
if computer_choice == "scissors": | ||
print("You Win") | ||
elif computer_choice == "paper": | ||
print("You Lose") | ||
else: | ||
print("It's a draw") | ||
elif user_choice == "paper": | ||
if computer_choice == "rock": | ||
print("You Win") | ||
elif computer_choice == "scissors": | ||
print("You Lose") | ||
else: | ||
print("It's a draw") | ||
else: | ||
if computer_choice == "paper": | ||
print("You Win") | ||
elif computer_choice == "rock": | ||
print("You Lose") | ||
else: | ||
print("It's a draw") |
Oops, something went wrong.