Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The same!, but I use reverse=True, select -1
They are called ternary operators.
Example :
if a>1:
x=a
else:
x= b
is written as x = a if a>1 else b
No point making the code do something you already know will not change based on the previous values
Side doesnt equal diameter. The diameter of the cylinder is the hypotenuse of two sides. U can use this to calculate a side
Side doesnt equal diameter. The diameter of the cylinder is the hypotenuse of two sides. U can use this to calculate a side
The question fails to convey that the corners of top part of the cuboid touch the cylinder
Look at it top down and draw a circle inside a square with all corners touching the circle.
The height of the cuboid is pretty obvious though so i guess i wont mention anything about that to not get in trouble
You can do alphabet.lower()
This is no longer needed for python 3
Why do you say not best practice?
Yeah I'm really interested in this feature as well
Hello, so an important concept in Object-Oriented Programming is INHERITANCE
So for example lets say you have a class Animal.
Now you create a class Dog(Animal)
any methods(functions) and parameters that were inside an Animal class is now also used by your Dog Class.
In the case of the question, the Class Ball(Object) means that the class Ball inherits the properties of the Class Object
This allows you to reuuse code from one class in a different class without needing to redefine the same methods and parameters.
I recommend you go watch a few videos on youtube to better understand this. Personally, I think that learning Java will help you understand Object-Oriented-Programming better.
Both inputs each contain dimensions to calculate volume of a cuboid.
A cuboid can never have more than 3 dimensions so there is no point in dynamically checking the list.
There is no division in that code. What do you mean?
Never knew the reduce function existed, thanks! Needed to import it to use in my own solution though
This comment is hidden because it contains spoiler information about the solution
Check my solution if you want to do it in the same way while handling an invalid colour
Loading more items...