Færdiggjort

python easy program

Part - I (5 points)

In this Assignment you are going to program a number guessing game. Using a loop is not necessary to complete the assignment, however it can make the code much easier to read rather than using nested IF statements.

Using the nested IF statements approach, the following steps need to be performed:

Initialize a variable called number with a value of 10 and a variable called numAttempts with a value of 0

Ask the user for their name

Ask the user to guess a number between 1 and 20 and store that in a variable guess, increment the numAttempts variable

If guess is same as number then say your guess is correct and you guessed it in n attempt(s), where n is the value of numAttempts variable and your program ends.

If guess is lower than number then print "Your guess is too low". If numAttempts variable < 3, the goto step #7 else goto step #8.

If guess is higher than number then print "Your guess is too high". If numAttempts variable < 3, the goto step #7 else goto step #8

Repeat step #3 - #6.

If the user does not guess the number even after three attempts then print “Your three guesses are over, the number I was thinking of was 10”

Sample 1

Hello! What is your name?

Albert

Well, Albert, I am thinking of a number between 1 and 20.

Take a guess.

15

Your guess is too high.

Take a guess.

4

Your guess is too low.

Take a guess.

12

Your guess is too high. Your three guesses are over. The number I was thinking of was 10

Sample 2

Hello! What is your name?

Albert

Well, Albert, I am thinking of a number between 1 and 20.

Take a guess.

8

Your guess is too low.

Take a guess.

12

Your guess is too high.

Take a guess.

10

Good job, Albert! You guessed my number in 3 guesses!

Optional: Instead of fixing the number to be guessed to 10, you can initialize 'number' variable with a random number between 1 and 20 that you generate using the functions in the random module. This way every time you re run the program, it is a different number to be guessed.

____________________________________________________________________________________________________

Part - II (5 points)

Rock, Paper, Scissor:

Write a program to simulate the paper-rock-scissor game. Each of the two players type in P, R, or S. The program then announces the winner based on the rule: Paper covers Rock, Rock breaks Scissors, Scissors cut Paper, or Nobody wins. Be sure to allow the players to use lowercase as well as uppercase letters.

You MUST implement a function that takes the choices that both the players made and returns 1 if the player 1 won and 2 if the player 2 won and 0 if it is a tie. So the logic of deciding who won based on the rock, paper, scissor rule must be programmed inside this function.

You MUST call this function to decide who won and you must display the result of the game based on the return value of the function.

Sample run:

Player 1: Please enter either (R)ock, (P)aper, or (S)cissors: P

Player 2: Please enter either (R)ock, (P)aper, or (S)cissors: s

Player 2 wins.

Optional: Your program can allow the users to play repeatedly say 5 times. Your program should then keep a score for each player and display that after each play.

Sample run (with optional part):

Player 1: Please enter either (R)ock, (P)aper, or (S)cissors: P

Player 2: Please enter either (R)ock, (P)aper, or (S)cissors: s

Player 2 wins.

Scores after this play:

Player 1: 0

Player 2: 1

Thanks!!

Evner: Ingeniørarbejde, Microsoft Access, PHP, Python, Software Arkitektur

Se mere: what to program, part time job python, need a python code that does, winner takes, scissors, R program, python game, albert, paper architecture, rock paper scissors code, rule logic code, architecture paper, functions rock paper scissors code, write function python, rock paper scissors program, paper cut, python function, function sample, tie software, rock paper scissors

Om arbejdsgiveren:
( 121 bedømmelser ) Calcutta, India

Projekt ID: #7071057

Tildelt til:

Fortut

A proposal has not yet been provided

₹400 INR / time
(29 bedømmelser)
4.2

9 freelancere byder i gennemsnit ₹291/time for dette job

anuyadav1

A proposal has not yet been provided

₹400 INR / time
(58 bedømmelser)
5.8
oneiricindia

Hello, I have gone through your project’s initial requirements with the help of the job posting you have placed. I have requisite experience and expertise to complete your project successfully. I am very much sure t Flere

₹247 INR / time
(26 bedømmelser)
5.3
SharjeelSohail

A proposal has not yet been provided

₹200 INR / time
(8 bedømmelser)
3.1
stolyaroleh

I would like to do this project, quickly. I work as a programming tutor in college and I have more than a year of experience programming in C++/C#/Java/Python. If you hire me, you will have it less than in 2 hours.

₹400 INR / time
(6 bedømmelser)
2.6
aamarnath

I have completed masters degree in computer programming. I am ready to do your assignment. I can complete it within 2 hour. Please give me a chance

₹230 INR / time
(0 bedømmelser)
0.0
ENGINEERING3000

Hello: I would like to code this games for you. Best Regards, Enrique -----------------------------------------------

₹277 INR / time
(0 bedømmelser)
0.0
emadulehsan

Hi there how are you? I'm Emad and I'm a software engineer and I've made both the games you mentioned as semester projects in Java. Currently I'm working with a team of python developers and have got strong grasp on Py Flere

₹222 INR / time
(0 bedømmelser)
0.0
mcmbuvi

Hi I am an experienced Python developer with excellent software engineering skills. I will be happy to work on these problems and deliver best solutions before the end of the day. My work experience includes intern Flere

₹277 INR / time
(0 bedømmelser)
0.0
GauravGurnani

Hello, I am new here and want to work part time. Your project would be a perfect start for a beginner that I am. I am pretty sure that i can solve your problem in a few hours time. I would do unlimited reviews and make Flere

₹200 INR / time
(0 bedømmelser)
0.0