from re import sub
Climb up the chart of development, from web, to software and games. Build your foundations and get certified. Let me help you get your first tech job.
10/1/22
Simple calculator using python and tkinter
9/11/22
Registration System
You are making a registration form for a website.
The form has a name field, which should be more than 3 characters long.
Any name that has less than 4 characters is invalid.
Complete the code to take the name as input, and raise an exception if the name is invalid, outputting "Invalid Name". Output "Account Created" if the name is valid.
Sample Input
abc
Sample Output
Invalid Name
Shooting Game
You are creating a shooting game!
The game has two types of enemies, aliens and monsters. You shoot the aliens using your laser, and monsters using your gun.
Each hit decreases the lives of the enemies by 1.
The given code declares a generic Enemy class, as well as the Alien and Monster classes, with their corresponding lives count.
It also defines the hit() method for the Enemy class.
You need to do the following to complete the program:
1. Inherit the Alien and Monster classes from the Enemy class.
2. Complete the while loop that continuously takes the weapon of choice from user input and call the corresponding object's hit() method.
Sample Input
laser
laser
gun
exit
Sample Output
Alien has 4 lives
Alien has 3 lives
Monster has 2 lives
9/8/22
Letter Counter
Given a string as input, you need to output how many times each letter appears in the string.
You decide to store the data in a dictionary, with the letters as the keys, and the corresponding counts as the values.
Create a program to take a string as input and output a dictionary, which represents the letter count.
Sample Input
hello
Sample Output
{'h': 1, 'e': 1, 'l': 2, 'o': 1}
Fruit Bowl
You have a bowl on your counter with an even number of pieces of fruit in it. Half of them are bananas, and the other half are apples. You need 3 apples to make a pie.
Task
Your task is to evaluate the total number of pies that you can make with the apples that are in your bowl given to total amount of fruit in the bowl.
Input Format
An integer that represents the total amount of fruit in the bowl.
Output Format
An integer representing the total number of whole apple pies that you can make.
Sample Input
26
Sample Output
4
6/30/22
Python as an OOPs
For those of you who don't know, oop stands for Object-Oriented Programming. Is python an oop, and why?
Blog Archive
- December 2022 (1)
- November 2022 (7)
- October 2022 (3)
- September 2022 (37)
- June 2022 (20)