Posts

Showing posts from November, 2021

Finance | Assets - Meaning and Types

Image
 What is an Asset? what are the Assets Types? What is an asset in business ? What is an Asset? Assets are the items your company owns that can provide future economic benefit. What are the types of Assets? Assets are classified based on liquidity. Liquidity means how quickly an asset can be turned into cash. 1- Fixed Assets - illiquid (non-liquid) assets:  These are assets owned by the company but need longer than a year to be converted to cash. They include company cars, real estate, machinery, coverage towers for telecom companies, buildings, furniture, office equipment, etc. They contribute to the income, but they are not consumed in the income generating process. 2- Liquid Assets: Liquid assets are those assets that can be turned into cash and be used immediately to pay liabilities in your balance sheet. Common liquid assets include: cash, certificates of deposit, stocks, precious metals (and they can be both liquid and fixed based on how you store them and their ava...

Play The Hidden Aliens Game

Image
Hide Aliens How many Aliens Hide? Focus, Pay attention, these aliens are playing games. They run towards the gate, but not all of them get out. Pay attention to the number of aliens hid behind the gate to win the game. Play Again

Python 4.3.1.10 LAB: Converting fuel consumption

Image
 Python 4.3.1.10 LAB: Converting fuel consumption 4.3.1.10 LAB Objectives improving the student's skills in defining, using and testing functions. Scenario A car's fuel consumption may be expressed in many different ways. For example, in Europe, it is shown as the amount of fuel consumed per 100 kilometers. In the USA, it is shown as the number of miles traveled by a car using one gallon of fuel. Your task is to write a pair of functions converting l/100km into mpg " mile per gallon ", and vice versa . Sandbox The functions: are named liters_100km_to_miles_gallon and miles_gallon_to_liters_100km respectively ; take one argument (the value corresponding to their names) Complete the code in the editor. Run your code and check whether your output is the same as ours. Here is some information to help you: 1 American mile = 1609.344 metres; 1 mile = "1.60934" meters 1 American gallon = 3.785411784 litres. Expected output 60.31143162393162 31.36194444444444 23....

Python 4.3.1.9 LAB: Prime numbers - how to find them

Image
  Objectives familiarizing the student with classic notions and algorithms; improving the student's skills in defining and using functions. Scenario A natural number is prime if it is greater than 1 and has no divisors other than 1 and itself. Complicated? Not at all. For example, 8 isn't a prime number, as you can divide it by 2 and 4 (we can't use divisors equal to 1 and 8, as the definition prohibits this). On the other hand, 7 is a prime number, as we can't find any legal divisors for it. Your task is to write a function checking whether a number is prime or not. The function: is called is_prime ; takes one argument (the value to check) returns True if the argument is a prime number, and False otherwise. Hint: try to divide the argument by all subsequent values ( starting from 2 ) and check the remainder - if it's zero , your number cannot be a prime ; think carefully about when you should stop the process . If you need to know the square root of any value, yo...

Python 4.3.1.8 LAB: Day of the year: writing and using your own functions

Image
 Day of the year: writing and using your own functions Day of the year: writing and using your own functions Prerequisites LAB 4.3.1.6 LAB 4.3.1.7 Objectives Familiarize the student with: projecting and writing parameterized functions; utilizing the return statement; building a set of utility functions; utilizing the student's own functions. Scenario Your task is to write and test a function which takes three arguments (a year, a month, and a day of the month) and returns the corresponding day of the year , or returns None if any of the arguments is invalid. Use the previously written and tested functions. Add some test cases to the code. This test is only a beginning. Stoooooooop .. we are here to real the REAL PYTHON, not this SILLY COURSE Dear learner  .. if you reached here, that means you'd have had enough of this boring course already😏. Let's learn python the right way, not the old school way. Solution Code: def is_leap_year ( year ): # LAB 4.3.1.6 A leap year ...

Python 4.3.1.7 LAB: How many days: writing and using your own functions

Image
writing and using your own functions writing and using your own functions Prerequisites LAB 4.3.1.6 Objectives Familiarize the student with: projecting and writing parameterized functions; utilizing the return statement; utilizing the student's own functions. Scenario Your task is to write and test a function which takes two arguments (a year and a month ) and returns the number of days for the given month/year pair (while only February is sensitive to the year value , your function should be universal). The initial part of the function is ready. Now, convince the function to return None if its arguments don't make sense.  What is needed Of course, you can (and should) use the previously written and tested function ( LAB 4.3.1.6 ). It may be very helpful. We encourage you to use a list filled with the months' lengths . You can create it inside the function - this trick will significantly shorten the code. We've prepared a testing code. Expand it to include more test ...

Python 4.3.1.6 LAB: A leap year: writing your own functions

Image
If you're taking PCAP - Programming Essentials In Python , you may have encountered this question  4.3.1.6 LAB: A leap year: writing your own functions Objectives Familiarize the student with: projecting and writing parameterized functions; utilizing the return statement; testing the functions. Scenario Your task is to write and test a function which takes one argument (a year) and returns True if the year is a leap year, or False otherwise. The seed of the function is already sown in the skeleton code in the editor. Note: we've also prepared a short testing code, which you can use to test your function. The code uses two lists - one with the test data, and the other containing the expected results. The code will tell you if any of your results are invalid. Important to know first: Normal year is 365 days (actually they're 356.25 days as per Nasa) Leap year is 366 days . Which means, leap year has an additional day added in February which makes it 29 days. A leap year occ...

What to use? -able or -ible?

Image
Comparison between "-able" and "-ible" What are "-able" and "-ible" ?  -able vs -ible Both are called "suffixes". Suffixes are a letter or group of letters added to the ending of words to change their meaning or function . These useful, shapeshifting tools can be as small as -s, and -ed, or can be larger additions such as -ation, and -ious. Know more about suffixes and prefixes here ... Rule of thumb - If you remove - able from a word, you are left with a complete word (renewable, renew). - If you remove - ible from a word, you are not left with a complete word (sensible, sens ). But note that accessible, contemptible, digestible, flexible and suggestible are among the exceptions to this rule. The most common -ible endings   Adjectives ending in ( -able ) Adjectives ending in (-ible) Examples Navig able , afford able Comprehens ible , permiss ible When to use ...

Prefixes vs Suffixes ? What are they?

Image
Prefixes: As per the dictionary, "pre" means previous to or before. So, prefixes are a group of letters placed before the original/root word. Examples and meanings: Un happy: un (prefix) means not . happy (root word, adjective). un happy means not happy. Re appear: re (prefix) means  again or back . appear (root word, verb). re appear means to appear again. Suffixes: Suffixes are a group of letters placed After/onto the end of  the original/root word. Examples and meanings: de value: value (root word, noun). de- (prefix) changes the noun to a verb with the opposite meaning. de- only means reverse, away, opposite Strong er : Strong (root word, adjective). -er ( suffix ) changes the adjective to a comparative meaning between 2 people or things. "He is strong, but his brother is stronger than him." Act ing : Act  (root word, verb). - ing ( suffix ) changes the verb to a noun/action. "She was not good at acting, so she changed her career to Engineering." ...