SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
Write a program that lets the user play the game of Rock, Paper, Scissors against the computer.
Requirements: (save the program as game.py and the log as ola104.log) - The program should
work as follows. 1. When the program begins, a random number in the range of 1 through 3 is
generated. If the number is 1 , then the computer has chosen rock. If the number is 2 , then the
computer has chosen paper. If the number is 3 , then the computer has chosen scissors. (Don't
display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", or
"scissors" at the keyboard. 3. The computer's choice is displayed. 4. Winer declared - Allow the
user to play multiple games. - Implement the following user-defined functions (required) as
described below. main0 # Main logic: top-level algorithm implements a flag controlled loop
calls intro0, get_comp_choice 0 , get_user_choice 0 , display_choices 0 , and keep_going0
functions intro0 # displays the description of game get_comp_choice0 # calls randint( function,
returns an int (computer choice) get_user_choice0 # gets user choice, implements an input
validation loop, calls choice_to_num0, and returns an int (user choice) choice_to_num(choice) #
accepts a string ("rock", "paper", or "scissors") and returns an int (1,2, or 3)
num_to_choice(num) # accepts an int (1,2, or 3) and returns a string ("rock", "paper", or
"scissors") display_choices(comp_choice, user_choice)# accepts two ints (1,2, or 3), calls
num_to_choice0 and display choices keep_going0 #gets users response and returns True if user
wants to play more

Weitere ähnliche Inhalte

Ähnlich wie Write a program that lets the user play the game of Rock, Paper, Scis.pdf

Game Programming I - Introduction
Game Programming I - IntroductionGame Programming I - Introduction
Game Programming I - IntroductionFrancis Seriña
 
01 the basics getting started with computers-esol
01 the basics getting started with computers-esol01 the basics getting started with computers-esol
01 the basics getting started with computers-esolOutlearn Training
 
#include iostream#include fstream#include Opening.h.docx
#include iostream#include fstream#include Opening.h.docx#include iostream#include fstream#include Opening.h.docx
#include iostream#include fstream#include Opening.h.docxadkinspaige22
 
Random 120507151041-phpapp02
Random 120507151041-phpapp02Random 120507151041-phpapp02
Random 120507151041-phpapp02Yazeed Khalid
 
It tools and buisness system.docx
It tools and buisness system.docxIt tools and buisness system.docx
It tools and buisness system.docxhinditutorialspoint
 
Android application - Tic Tac Toe
Android application - Tic Tac ToeAndroid application - Tic Tac Toe
Android application - Tic Tac ToeSarthak Srivastava
 
How to Download & Install Print Drivers MAC
How to Download & Install Print Drivers MACHow to Download & Install Print Drivers MAC
How to Download & Install Print Drivers MACMelissa Heck
 
IRJET- IoT based Gesture Control Gaming
IRJET- IoT based Gesture Control GamingIRJET- IoT based Gesture Control Gaming
IRJET- IoT based Gesture Control GamingIRJET Journal
 
プレゼンテーション2
プレゼンテーション2プレゼンテーション2
プレゼンテーション2KA_ZU
 

Ähnlich wie Write a program that lets the user play the game of Rock, Paper, Scis.pdf (14)

Game Programming I - Introduction
Game Programming I - IntroductionGame Programming I - Introduction
Game Programming I - Introduction
 
01 the basics getting started with computers-esol
01 the basics getting started with computers-esol01 the basics getting started with computers-esol
01 the basics getting started with computers-esol
 
#include iostream#include fstream#include Opening.h.docx
#include iostream#include fstream#include Opening.h.docx#include iostream#include fstream#include Opening.h.docx
#include iostream#include fstream#include Opening.h.docx
 
Random 120507151041-phpapp02
Random 120507151041-phpapp02Random 120507151041-phpapp02
Random 120507151041-phpapp02
 
It tools and buisness system.docx
It tools and buisness system.docxIt tools and buisness system.docx
It tools and buisness system.docx
 
Week3.pptx
Week3.pptxWeek3.pptx
Week3.pptx
 
Android application - Tic Tac Toe
Android application - Tic Tac ToeAndroid application - Tic Tac Toe
Android application - Tic Tac Toe
 
How to Download & Install Print Drivers MAC
How to Download & Install Print Drivers MACHow to Download & Install Print Drivers MAC
How to Download & Install Print Drivers MAC
 
IRJET- IoT based Gesture Control Gaming
IRJET- IoT based Gesture Control GamingIRJET- IoT based Gesture Control Gaming
IRJET- IoT based Gesture Control Gaming
 
Game engine
Game engineGame engine
Game engine
 
Basic computer skills of BSc IT
Basic computer skills of BSc ITBasic computer skills of BSc IT
Basic computer skills of BSc IT
 
Basic of computer (1)
Basic of computer (1)Basic of computer (1)
Basic of computer (1)
 
プレゼンテーション2
プレゼンテーション2プレゼンテーション2
プレゼンテーション2
 
Bow&arrow game
Bow&arrow gameBow&arrow game
Bow&arrow game
 

Mehr von amanstudio07860

X-Gal is included in the growth medium on which cells transformed wit.pdf
 X-Gal is included in the growth medium on which cells transformed wit.pdf X-Gal is included in the growth medium on which cells transformed wit.pdf
X-Gal is included in the growth medium on which cells transformed wit.pdfamanstudio07860
 
Write the SQL command to insert a row of data into the table ORDERS i.pdf
 Write the SQL command to insert a row of data into the table ORDERS i.pdf Write the SQL command to insert a row of data into the table ORDERS i.pdf
Write the SQL command to insert a row of data into the table ORDERS i.pdfamanstudio07860
 
Written Assignment 6 , respond to the following question. As the text.pdf
 Written Assignment 6 , respond to the following question. As the text.pdf Written Assignment 6 , respond to the following question. As the text.pdf
Written Assignment 6 , respond to the following question. As the text.pdfamanstudio07860
 
Write two paths to reach the following directoriesIs the following.pdf
 Write two paths to reach the following directoriesIs the following.pdf Write two paths to reach the following directoriesIs the following.pdf
Write two paths to reach the following directoriesIs the following.pdfamanstudio07860
 
Write the class named Student which has the following data members - .pdf
 Write the class named Student which has the following data members - .pdf Write the class named Student which has the following data members - .pdf
Write the class named Student which has the following data members - .pdfamanstudio07860
 
write minimum 250 words essay Topic Be a real state agent required a.pdf
 write minimum 250 words essay Topic Be a real state agent required a.pdf write minimum 250 words essay Topic Be a real state agent required a.pdf
write minimum 250 words essay Topic Be a real state agent required a.pdfamanstudio07860
 
Write Java variable declarations to create one int variable called nu.pdf
 Write Java variable declarations to create one int variable called nu.pdf Write Java variable declarations to create one int variable called nu.pdf
Write Java variable declarations to create one int variable called nu.pdfamanstudio07860
 
Write coding using c language develop a prototype application for dat.pdf
 Write coding using c language develop a prototype application for dat.pdf Write coding using c language develop a prototype application for dat.pdf
Write coding using c language develop a prototype application for dat.pdfamanstudio07860
 
Write an application that ask the user to enter 2 integers, obtains.pdf
 Write an application that ask the user to enter 2 integers, obtains.pdf Write an application that ask the user to enter 2 integers, obtains.pdf
Write an application that ask the user to enter 2 integers, obtains.pdfamanstudio07860
 
Write a single C statement that corresponds to the two MIPS assembly .pdf
 Write a single C statement that corresponds to the two MIPS assembly .pdf Write a single C statement that corresponds to the two MIPS assembly .pdf
Write a single C statement that corresponds to the two MIPS assembly .pdfamanstudio07860
 
Write a recursive function elemAt that returns the ith item of the li.pdf
 Write a recursive function elemAt that returns the ith item of the li.pdf Write a recursive function elemAt that returns the ith item of the li.pdf
Write a recursive function elemAt that returns the ith item of the li.pdfamanstudio07860
 
Write a recursive function flip that takes a list of pairs, and retu.pdf
 Write a recursive function flip that takes a list of pairs, and retu.pdf Write a recursive function flip that takes a list of pairs, and retu.pdf
Write a recursive function flip that takes a list of pairs, and retu.pdfamanstudio07860
 
Write a Python module called inches2centimeters that will accept one .pdf
 Write a Python module called inches2centimeters that will accept one .pdf Write a Python module called inches2centimeters that will accept one .pdf
Write a Python module called inches2centimeters that will accept one .pdfamanstudio07860
 
Write a Python program that can perform the following operations on a.pdf
 Write a Python program that can perform the following operations on a.pdf Write a Python program that can perform the following operations on a.pdf
Write a Python program that can perform the following operations on a.pdfamanstudio07860
 
Write a program that stores integers in a linked list. Please refer t.pdf
 Write a program that stores integers in a linked list. Please refer t.pdf Write a program that stores integers in a linked list. Please refer t.pdf
Write a program that stores integers in a linked list. Please refer t.pdfamanstudio07860
 
Write a program that creates 2 Lists. The first is the list of names .pdf
 Write a program that creates 2 Lists. The first is the list of names .pdf Write a program that creates 2 Lists. The first is the list of names .pdf
Write a program that creates 2 Lists. The first is the list of names .pdfamanstudio07860
 
Write a program that implements a function. The function should creat.pdf
 Write a program that implements a function. The function should creat.pdf Write a program that implements a function. The function should creat.pdf
Write a program that implements a function. The function should creat.pdfamanstudio07860
 
Write a program named ArrayDemo that stores an array of 10 integers. .pdf
 Write a program named ArrayDemo that stores an array of 10 integers. .pdf Write a program named ArrayDemo that stores an array of 10 integers. .pdf
Write a program named ArrayDemo that stores an array of 10 integers. .pdfamanstudio07860
 
Write a Java program to represent a family tree. A sample family tree.pdf
 Write a Java program to represent a family tree. A sample family tree.pdf Write a Java program to represent a family tree. A sample family tree.pdf
Write a Java program to represent a family tree. A sample family tree.pdfamanstudio07860
 
Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf
 Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf
Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdfamanstudio07860
 

Mehr von amanstudio07860 (20)

X-Gal is included in the growth medium on which cells transformed wit.pdf
 X-Gal is included in the growth medium on which cells transformed wit.pdf X-Gal is included in the growth medium on which cells transformed wit.pdf
X-Gal is included in the growth medium on which cells transformed wit.pdf
 
Write the SQL command to insert a row of data into the table ORDERS i.pdf
 Write the SQL command to insert a row of data into the table ORDERS i.pdf Write the SQL command to insert a row of data into the table ORDERS i.pdf
Write the SQL command to insert a row of data into the table ORDERS i.pdf
 
Written Assignment 6 , respond to the following question. As the text.pdf
 Written Assignment 6 , respond to the following question. As the text.pdf Written Assignment 6 , respond to the following question. As the text.pdf
Written Assignment 6 , respond to the following question. As the text.pdf
 
Write two paths to reach the following directoriesIs the following.pdf
 Write two paths to reach the following directoriesIs the following.pdf Write two paths to reach the following directoriesIs the following.pdf
Write two paths to reach the following directoriesIs the following.pdf
 
Write the class named Student which has the following data members - .pdf
 Write the class named Student which has the following data members - .pdf Write the class named Student which has the following data members - .pdf
Write the class named Student which has the following data members - .pdf
 
write minimum 250 words essay Topic Be a real state agent required a.pdf
 write minimum 250 words essay Topic Be a real state agent required a.pdf write minimum 250 words essay Topic Be a real state agent required a.pdf
write minimum 250 words essay Topic Be a real state agent required a.pdf
 
Write Java variable declarations to create one int variable called nu.pdf
 Write Java variable declarations to create one int variable called nu.pdf Write Java variable declarations to create one int variable called nu.pdf
Write Java variable declarations to create one int variable called nu.pdf
 
Write coding using c language develop a prototype application for dat.pdf
 Write coding using c language develop a prototype application for dat.pdf Write coding using c language develop a prototype application for dat.pdf
Write coding using c language develop a prototype application for dat.pdf
 
Write an application that ask the user to enter 2 integers, obtains.pdf
 Write an application that ask the user to enter 2 integers, obtains.pdf Write an application that ask the user to enter 2 integers, obtains.pdf
Write an application that ask the user to enter 2 integers, obtains.pdf
 
Write a single C statement that corresponds to the two MIPS assembly .pdf
 Write a single C statement that corresponds to the two MIPS assembly .pdf Write a single C statement that corresponds to the two MIPS assembly .pdf
Write a single C statement that corresponds to the two MIPS assembly .pdf
 
Write a recursive function elemAt that returns the ith item of the li.pdf
 Write a recursive function elemAt that returns the ith item of the li.pdf Write a recursive function elemAt that returns the ith item of the li.pdf
Write a recursive function elemAt that returns the ith item of the li.pdf
 
Write a recursive function flip that takes a list of pairs, and retu.pdf
 Write a recursive function flip that takes a list of pairs, and retu.pdf Write a recursive function flip that takes a list of pairs, and retu.pdf
Write a recursive function flip that takes a list of pairs, and retu.pdf
 
Write a Python module called inches2centimeters that will accept one .pdf
 Write a Python module called inches2centimeters that will accept one .pdf Write a Python module called inches2centimeters that will accept one .pdf
Write a Python module called inches2centimeters that will accept one .pdf
 
Write a Python program that can perform the following operations on a.pdf
 Write a Python program that can perform the following operations on a.pdf Write a Python program that can perform the following operations on a.pdf
Write a Python program that can perform the following operations on a.pdf
 
Write a program that stores integers in a linked list. Please refer t.pdf
 Write a program that stores integers in a linked list. Please refer t.pdf Write a program that stores integers in a linked list. Please refer t.pdf
Write a program that stores integers in a linked list. Please refer t.pdf
 
Write a program that creates 2 Lists. The first is the list of names .pdf
 Write a program that creates 2 Lists. The first is the list of names .pdf Write a program that creates 2 Lists. The first is the list of names .pdf
Write a program that creates 2 Lists. The first is the list of names .pdf
 
Write a program that implements a function. The function should creat.pdf
 Write a program that implements a function. The function should creat.pdf Write a program that implements a function. The function should creat.pdf
Write a program that implements a function. The function should creat.pdf
 
Write a program named ArrayDemo that stores an array of 10 integers. .pdf
 Write a program named ArrayDemo that stores an array of 10 integers. .pdf Write a program named ArrayDemo that stores an array of 10 integers. .pdf
Write a program named ArrayDemo that stores an array of 10 integers. .pdf
 
Write a Java program to represent a family tree. A sample family tree.pdf
 Write a Java program to represent a family tree. A sample family tree.pdf Write a Java program to represent a family tree. A sample family tree.pdf
Write a Java program to represent a family tree. A sample family tree.pdf
 
Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf
 Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf
Worksheet No. 3 - Upper left side of the worksheet, prepare the State.pdf
 

Kürzlich hochgeladen

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 

Write a program that lets the user play the game of Rock, Paper, Scis.pdf

  • 1. Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. Requirements: (save the program as game.py and the log as ola104.log) - The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1 , then the computer has chosen rock. If the number is 2 , then the computer has chosen paper. If the number is 3 , then the computer has chosen scissors. (Don't display the computer's choice yet.) 2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. 3. The computer's choice is displayed. 4. Winer declared - Allow the user to play multiple games. - Implement the following user-defined functions (required) as described below. main0 # Main logic: top-level algorithm implements a flag controlled loop calls intro0, get_comp_choice 0 , get_user_choice 0 , display_choices 0 , and keep_going0 functions intro0 # displays the description of game get_comp_choice0 # calls randint( function, returns an int (computer choice) get_user_choice0 # gets user choice, implements an input validation loop, calls choice_to_num0, and returns an int (user choice) choice_to_num(choice) # accepts a string ("rock", "paper", or "scissors") and returns an int (1,2, or 3) num_to_choice(num) # accepts an int (1,2, or 3) and returns a string ("rock", "paper", or "scissors") display_choices(comp_choice, user_choice)# accepts two ints (1,2, or 3), calls num_to_choice0 and display choices keep_going0 #gets users response and returns True if user wants to play more