Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python . Lab Week 6-Strings Skille Needed to complete tis Lab - Index, sice strings e Iterate over strings . use string methods e

In python . image text in transcribed
image text in transcribed
Lab Week 6-Strings Skille Needed to complete tis Lab - Index, sice strings e Iterate over strings . use string methods e use the random module Code Breaker Code breaker is a simple game where the program will create a 5 digit code with 10 possible characters (ABCDEFGHIJ). The player will be allowed to guess the code, if they guess right, then the game is over, if they guess wrong, then they are told how many characters were correct. They are also told how many characters were in the correct place. If the code generated is dbgh, and the user guesses abde, then the program lets them know that they got 2 of the characters correct ( the b and the d). The program also informs them that they got one letter in the correct place. In this case it is the b. (The users are not told which characters or positions are correct, only the number. You will want to use functions to break the program down as much as possible into smaller tasks. While you are testing you may also want to show code word so that it is easier to test. Example Program Try to guess the code word Enter your guess 5 characters ABCDE 3 correct, e in the right space Enter your guess 5 charactersBACDE 3 correct, 1 in the right space Enter your guess 5 charactersBIAE You guess the correct word BIAE) in 3 tries Do you want to play again (Y/N) y Try to guess the code word Enter your guess 5 characters EHJBC 5 correct, 1 in the right space Enter your guess 5 characters>cBJHE You guess the correct word CB3HE in 2 tries Do you want to play again (Y/N) Grading and Turning In Turn in your program before the end of the lab. Only upload the Lab5.py file, as other files will be ignored

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions