
- 27th Jul 2024
- 20:56 pm
In this assignment pick one of these projects and write the python code. OR you can create one on your own with my approval.
- Rock, Paper, Scissors (Code should ask the user to make a choice, randomly select computer choice, and keep track of score. Game to 5. -1 to Quit.)
- Mad Libs (PG Rated) (Code should ask the user for input and then create Mad Lib)
- Hangman (Code should randomly select a word from "storage" (list, file, etc.), display name of body part (picture not needed).
- Password Generator (User enters a work and then the program creates a 16 digit password).
- Calculator (Use a menu, create a calculator, no picture needed, basic calculator (plus, minus, divide, multiply).
- Attachments/Submittal (Depending on the task you choose):
- File 1: Pandas Assignment python file (Do not name file pandas)
- Pandas Assignment Python File --> The python code file (.py) that has your pandas code in it.
- File 2: Screenshot of pandas results
- File 3: Downloaded CSV File
- File 4.• Screenshot of Graph File 5.• Task 2 python file
Free Assignment Solution - Select And Build A Python Application
import random
# list containing options available to user for game
choices = ['rock', 'paper', 'scissor']
def get_computer_choice():
index = random.randint(0,2)
return choices[index]
# This function ask user his choice validate it and return it
def get_user_choice():
while True:
print('Select From Below')
print('Rock')
print('Paper')
print('Scissor')
user_choice = input('Enter Your Choice: ')
user_choice = user_choice.lower()
if user_choice in choices:
return user_choice
else:
print('Invalid Choice')
# This function is used to play the game
def play_game():
user_score = 0
computer_score = 0
print('Welcome to Rock Paper Scissor')
print('Best Of 5 wins')
count = 0
while True:
count = count + 1
print('\nRound:',count)
user_choice = get_user_choice()
computer_choice = get_computer_choice()
print("Computer Choice: ",computer_choice)
if user_choice == computer_choice:
print("Tie!")
elif user_choice == "rock":
if computer_choice == "paper":
print("You lose!", computer_choice, "covers", user_choice)
computer_score = computer_score + 1
else:
print("You win!", user_choice, "smashes", computer_choice)
user_score = user_score + 1
elif user_choice == "paper":
if computer_choice == "scissor":
print("You lose!", computer_choice, "cut", user_choice)
computer_score = computer_score + 1
else:
print("You win!", user_choice, "covers", computer_choice)
user_score = user_score + 1
elif user_choice == "scissor":
if computer_choice == "rock":
print("You lose...", computer_choice, "smashes", user_choice)
computer_score = computer_score + 1
else:
print("You win!", user_choice, "cut", computer_choice)
user_score = user_score + 1
if count == 5:
break
if user_score == computer_score:
print("Its a tie")
elif user_score > computer_score:
print('User Wins')
else:
print('Computer Wins')
play_game()
Get the best Python Application assignment help and tutoring services from our experts now!
This sample Python assignment solution has been successfully completed by our team of Python programmers. The solutions provided are designed exclusively for research and reference purposes. If you find value in reviewing the reports and code, our Python tutors would be delighted.
-
For a comprehensive solution package including code, reports, and screenshots, please visit our Python Assignment Sample Solution page.
-
Contact our Python experts for personalized online tutoring sessions focused on clarifying any doubts related to this assignment.
-
Explore the partial solution for this assignment available in the blog above for further insights.
About The Author - Taylor Morgan
Taylor Morgan is an aspiring software developer with a keen interest in Python programming and interactive application development. For this assignment, Taylor selected [Project Name: Rock, Paper, Scissors / Mad Libs / Hangman / Password Generator / Calculator] to showcase coding skills and creativity.