Question

Hello I need a flowchart made for reference I am using flowgorithm Here is the python...

Hello I need a flowchart made for reference

I am using flowgorithm

Here is the python code that I need a flowchart for

def get_user_input_validated():

"""

Module Name: get_user_input_validated

Parameters: None

Description: Defence program validates input as rock, paper or scissors

returns input in lowercase making input case insensitive

"""

choice=["rock","paper","scissors"]

while True:

user_choice = input("Please enter your choice (rock/paper/scissors):")

if user_choice.lower() in choice:

break

else:

print("Sorry - that selection is not valid.",end="")

return user_choice.lower()

Homework Answers

Answer #1

Here is the function getUserInputValidated.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Code in Python Hello I need an os module to restart and re-run the whole code...
Code in Python Hello I need an os module to restart and re-run the whole code when the multiplier limit is reached. So when the code stops the outputs I need it to initialize again. import os, sys initial=int(input("Initial value : "))       #taking inputs multiplier=float(input("Multiplier : ")) compound=int(input("No of compounds : ")) print("Your values are:") mult=initial                         #initalizing to find answer for i in range(0,compound):         #multiplying by multiplier     print(round(mult,1))     mult=mult*multiplier
I need some tests for this python class. some tests for some of the functions in...
I need some tests for this python class. some tests for some of the functions in this class like. def __init__ def __eq__ def __lt__ def __hash__ I am using Pycharm and useing Pytest to write some tests but have no idea how to write one --------------------------------------------------------------------------------------------------- class Movie: def __set_title_internal(self, title: str): if title.strip() == "" or type(title) is not str: self.__title = None else: self.__title = title.strip() def __set_release_year_internal(self, release_year: int): if release_year >= 1900 and type(release_year) is...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21,...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21, all players who are still standing win. But the players that are not standing have already lost. If the Dealer does not go over 21 but stands on say 19 points then all players having points greater than 19 win. All players having points less than 19 lose. All players having points equal to 19 tie. The program should stop asking to hit if...
You will write a program that loops until the user selects 0 to exit. In the...
You will write a program that loops until the user selects 0 to exit. In the loop the user interactively selects a menu choice to compress or decompress a file. There are three menu options: Option 0: allows the user to exit the program. Option 1: allows the user to compress the specified input file and store the result in an output file. Option 2: allows the user to decompress the specified input file and store the result in an...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT