PMCA Friday Python CCC
Home > PMCA Friday Python CCC (Page 11)
Question:
Write a Python program (either use function or object method) to check the validity of password input by users.
Validation :
At least 1 letter between [a-z] and 1 letter between[A-Z].
At least 1 number between [0-9].
At least 1 character from [$#@].
Minimum length 6...
Question:
Create an object WordReverse to reverse a string.
You need one argument (which is the original string) to create the object.
def __init__(self, word):
You need one method to reverse the string
def reverse(self):
You can print the object with the following expected output...
Import practice:
Question 1.
Write a short program to generate a list of five random integer numbers from 1 to 20, and print them out.
Question 2.
Write a short program that prints out a random decimal number every 3 seconds for 30 seconds
Bonus Question (Difficulty: Hard):
Write a function to print your name...
Question:
Create an OunceConversion object to convert any number of fluid ounces to the equivalent number of gallons, quarts, pints, and gills. (There are 128 fluid ounces in a gallon. There are 32 fluid ounces in a quart. There are 16 fluid ounces in a pint. There are 4 fluid...
Question:
Create a Tank object which have the attributes of:
name
direction(up/down/left/right)
x position and
y position
The object also have a method:
move (direction, steps)
Using __init__ to Initial the tank to make sure it start from x position of 0 and y position of 0
Print out the...
Question:
Make a class definition for a BankAccount. It should have attributes for :
- its name (a string),
- account number (a string or integer),
- and balance (a float).
It should have methods to:
- make deposits with displaying the balance,
- and make withdrawals with displaying the balance.
Hint:
...
Question:
Please write a program using function. Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:
if a player wins 5 or 6 games, they are placed...