0% found this document useful (0 votes)
19 views1 page

Python Practice Assignment

The document provides instructions for 10 Python programming assignments including programs for bubble sort, removing list elements, running an infinite loop, creating acronyms, finding array indices that sum to a target, finding the median of two sorted arrays, validating parentheses in a string, selection sort, playing rock paper scissors against the computer, and verifying a username and password with three attempts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Python Practice Assignment

The document provides instructions for 10 Python programming assignments including programs for bubble sort, removing list elements, running an infinite loop, creating acronyms, finding array indices that sum to a target, finding the median of two sorted arrays, validating parentheses in a string, selection sort, playing rock paper scissors against the computer, and verifying a username and password with three attempts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Practice Assignment

1. Write a program to do bubble sort.


2. Write a program to input a list and its element and remove all occurrences of the
given element from the list.
3. Write a program to run an infinite loop until the user types "q" or "Q".
4. write a python program to create Acronyms for the given phrase as input using
Python.
5. Given an array of integers numbers and an integer target, return indices of the two
numbers such that they add up to target.
6. Given two sorted arrays nums1 and nums2 of size m and n respectively, return the
median of the two sorted arrays.
7. Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the
input string is valid.
8. Write a program to do selection sort.
9. Let’s create a program to play rock, paper ,scissor game with the computer using
python programs follow the rules below to declare win <br>

a) 1.p1(player 1) = rock and p2 (player2) = scissor win = p1


b) 2.p1 = rock and p2 = paper win = p2
c) 3.p1= scissor and p2 paper win = p1
d) 4.p1=p2 then "tie"

finally ask the user if he wants to continue the game or not, say Y or N, based on his
input continue the game or quit the game.

10. Write a program to get a username and password and verify if it is right.

1) Give three chances to verify the password


2) If the username is not found, say "username not found " and exit
3)Get the input of password as hidden form.

You might also like