I gang

python program

1: Rock, Paper, Scissors (Topics: Variables, user-input, flow-control, function) [20pnts] Task 1 implements the "rock, paper, scissors" game. This is a two-player game, where

each player simultaneously selects from one of three options: rock, paper, scissors.

The game is typically played with hand gestures and has the following rules:

Rock wins against scissors, loses to paper, ties with rock. Paper wins against rock, loses to scissors, ties with paper. Scissors win against rock, lose to paper, tie with scissors.

Image credit: Enzoklop (CC) In our version, the user will select first, and then the computer opponent named "HAL" will make a random selection.

In a real game, both players would make their selection simultaneously.

Require function

In addition to the task1() function, you need to implement the following function: printOutcome(params: userSelection, computerSelection) -> no return

The parameters are the user's and computer's selection. The function prints the outcomes depending on the selections: (1) "You win!"; (2) "HAL wins!"; (3) "A tie!"

You decide what data type the parameters should be (e.g., integers representing the selection or strings representing "rock", "paper", "scissors"). Just ensure your function prints the correct outcome.

Task 1 should behave as follows:

(1) Print "Rock, Paper, Scissors!"

(2) Print "Make your selection. . ."

(3) Get input from user – 1 (rock), 2 (paper), 3 (scissors).

(4) If the input is not 1, 2, or 3, print "Invalid selection. Try again." and ask the user for input again.

(5) Randomly select HAL's choice – rock, paper, scissors.

(6) Print out the user's selection and HAL's selection.

(7) Pass the user's and HAL's selections to the function printOutcome() to print the outcome of the game. (8) Ask the user if they want to play again (Y). If the input is 'Y' or 'y', go back to (2).

Task 2 – Adjacent element swap for a list (Topics: list, loops, functions, string manipulation, assert) [20pnts] The user will input a string as a series of characters separated by spaces. The input string should be converted to a list of characters. Task 2 is to swap the values of every two items in the list; for example – items at positions 0 and 1 are swapped; items 2 and 3 are swapped; items 4 and 5 are swapped, and so on, until the end of the list. You can assume that the list has at least two items – if not, your swap function should raise an AssertionError (see details below).

Note that there are two cases: (1) the list has an even number of elements; (2) the list has an odd number of elements. For case 1, swap all elements. For case 2, swap all elements but leave the last element unchanged.

See the diagram below for examples.

Require function

In addition to the task2() function, you need to implement the following function: swapAdjacentElements(params: alist) -> no return

The parameter alist is a list of characters. The function should modify the list as described above. should modify the list passed to the function and not create a new list. The function has no return. ASSERT: This function should assert with the following error if the list has less than two (2) characters:

"Must enter two or more characters!"

Task 2 should behave as follows:

(1) Prompt the user to input a sequence of two or more characters separated by spaces. (2) Convert the input string into a list of characters.

(3) Print the list.

(4) Print the list as a string with no spaces between the characters.

(5) Call function swapAdjacentElements() to modify the list.

See instructions above. This function does not create a new list; instead, it should modify the list passed as an argument.

(6) Print the list again to show that the list has been modified.

(7) Print the list as a string again with no spaces between the characters

Evner: Python

Se mere: help writing python program enter payroll information, net custom control give list options property, 1000 input output program variables, python program extract info website, program coding climate control system, program choose climate control system, python program craps, flow control using, python program checks validity numbers, interface python program reads csv outputs csv, python program play craps, preferred vendor program process flow, flow control linux network stack, javascript cover flow control, program dc motor control microcontroller, python program count days, write program code udp using flow control, tipe tipe instruksi data processing data storage data movement program flow control, program to generate control flow graph

Om arbejdsgiveren:
( 0 bedømmelser ) North York, Canada

Projekt ID: #32299381

Tildelt til:

mustajab95

Hi, I have read all the requirements and I can complete this activity in just 1 day if given the opportunity. I have 3 + years of experience in python development and I would love to work on this.

$33 CAD / time
(1 bedømmelse)
0.0

24 freelancere byder i gennemsnit $22/timen for dette job

Daniildedov

Dear Client, Thanks for your job posting and I hope you are doing well. I read your job description and understood what you are expecting. I have more than 10 years of experiences in web app developments, so I can do Flere

$25 CAD / time
(7 bedømmelser)
6.0
tausy

Hello there, Greetings! I'm a software developer with over 7 years of industry experience working on Java and Python programming. I hold a Master's degree in Computer Science from Trinity College Dublin and successf Flere

$25 CAD / time
(58 bedømmelser)
6.0
oxankaorb

Hello, Thank you for your job posting. I have good experience to work with developing script using python. As a 5 yrs experience with software development, work with medium and big companies in russia. Through reading Flere

$20 CAD / time
(3 bedømmelser)
4.8
shashaev96

Professional Software Developer️ Hello , I hope you are safe and Doing well I have seen your project requirements , I am looking to discuss further with you Hope we will meet soon to discuss further Coming to me, I Flere

$20 CAD / time
(18 bedømmelser)
4.6
it2051229

Hi there, I do Python programming. I went through your requirements and I would like to do this project if given the opportunity. Let me know if you are interested.

$20 CAD / time
(38 bedømmelser)
4.8
sapnathakur14

Hello, Wish you had a good day, Thank you for your project. I've just checked your job description carefully. I'm senior developer with 6+ years of Python,Django and Flask. By using Python, I developed AI engine, BOT Flere

$20 CAD / time
(1 bedømmelse)
4.2
RomanMatveev1

I have gone through your requirements and I can do the project for sure. Hello, dear! I am a professional software developer and my skills include C, C++, C#, Java and Python. I have made several games using Python. I Flere

$20 CAD / time
(8 bedømmelser)
4.4
techplusintl

Hi there, ★★★ Python Expert ★★★ 9+ Years of Experience ★★★ I've read requirements and ready to work on your project. Websites we built with Python: ✔ [login to view URL] ✔ [login to view URL] ✔ https://unitialprop Flere

$25 CAD / time
(12 bedømmelser)
5.3
suyashdhoot

Hi I am a very experienced statistician, data scientist and academic writer. I have completed several PhD level thesis projects involving advanced statistical analysis of data. I have worked with data from several comp Flere

$25 CAD / time
(25 bedømmelser)
5.7
freelancerIrvan

Hi there, I am a talented python dev, and I suppose I can handle this task successfully. Please let me know more details, and Please give me your chance. I look forward to hearing from you. Flere

$20 CAD / time
(5 bedømmelser)
4.1
EgorKovalev

Hello. I have read your job description and It makes me interest. I am a 7+ years experienced Software developer who is good at Python and Algorithm. I will maintain good communication with you and I can work in your t Flere

$20 CAD / time
(2 bedømmelser)
3.9
romanvaraksin

Hello, dear! I have a deep experience with python. I have mastered algorithms and data structure. I can solve your problem very fast. Please contact me. Respectfully yours.

$20 CAD / time
(7 bedømmelser)
3.2
itcdamico

Hello, I'm an experienced Python developer. I can provide you an elegant and documented implementation for your exam in very short time.

$20 CAD / time
(5 bedømmelser)
2.7
InstantCreate

As a web developer, my skill is perfect in your job .. I have Skills in PHP, WordPress(CMS), HTML5, CSS3, JavaScript, jQuery, Bootstrap, PSD to HTML, Website design HTML, Laravel, PHP, MySQL and Website Design. :-We wi Flere

$20 CAD / time
(2 bedømmelser)
2.8
maksmyhalat

Hi, How are you? I am very interested in your project. I am an expert in math, physics. I have +5 experiences in matlab, python, R Programming. I read your description for project carefully. I’ve worked on several sim Flere

$15 CAD / time
(3 bedømmelser)
2.5
abdelilahnaddah

Hello, I can do this.

$25 CAD / time
(1 bedømmelse)
2.5
CodingHelpLine

Hello Sir/Madam I have development experience in various Programming Languages, OOP, Data Structures, Database Driven applications, APIs, Files handling and Data Transformation, ETL and various frameworks. I assure y Flere

$25 CAD / time
(1 bedømmelse)
1.5
Koki1216

Hi, I am excellent mathematician. With over 5 years of experience in Python. I’ve gone through your complete project description. My main skills are as follows: Python, Machine Learning Thank you for your attention. H Flere

$25 CAD / time
(0 bedømmelser)
0.0
dmycheshko

Hello, How are you today? Thank you for posting this project, and I'm very happy to bid on your project. I've read carefully your project details. I have rich experiences related to your project. Your satisfaction with Flere

$20 CAD / time
(1 bedømmelse)
0.0
tanaychaturvedi8

Hello I am 4 star coder at codechef and expert at codeforces. (C/C++/python). I can easily do you project as I am the co-ninja of bitbyte programming club of my college(IIITDM Jabalpur) also teaches more than 30 studen Flere

$15 CAD / time
(0 bedømmelser)
0.0