Skip to content

laibanasir/code-fest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-fest

This repository contains the following 10 tasks.

Find the leap year.

You've got chickens (2 legs), cows (4 legs) and pigs (4 legs) on your farm. Return the total number of legs on your farm.

Your task is to write a computer program that asks the user if they are looking for a fiction or a non-fiction book. Based on the user answer the program will ask the user to choose the genre from a list of available genres. Finally the program will return the location (A to I) of books of this genre.

Given the participants' score sheet for your University Sports Day, you are required to find the runner-up score. You are given scores. Store them in a list and find the score of the runner-up.

Create a function that takes two strings as arguments and return either True or False depending on whether the total number of characters. Is the first string is equal to the total number of characters in the second string.

PASSWORD CHECKER

Create a function that validates a password to conform to the following rules:

  1. Length between 6 and 24 characters.
  2. At least one uppercase letter (A-Z).
  3. At least one lowercase letter (a-z).
  4. At least one digit (0-9).
  5. Maximum of 2 repeated characters.

MAJORITY VOTES

Create a function that returns the majority vote in a list. A majority vote is an element that occurs > N/2 times in a list (where N is the length of the list).

  1. The frequency of the majority element must be strictly greater than 1/2.
  2. If there is no majority element, return None.
  3. If the list is empty, return None.

POSSIBLE PALINDROME

Create a class "possible_palindrom" and a class method "checking_palindrom" that determines whether it is possible to build a palindrome from the characters in a string.

PIZZA POINTS

Create a function that takes a dictionary of customers, a minimum number of orders and a minimum order price. Return a list of customers that are eligible for a free pizza.

REMOVE DUPLICATES FROM A LIST

Create a function that takes a list of items, removes all duplicate items and returns a new list in the same sequential order as the old list (minus duplicates). (SET built-in function is not allowed)

python 3.7