About 11,000,000 results
Open links in new tab
  1. Find Cube of a Number – Python | GeeksforGeeks

    May 5, 2025 · The cube of a number is calculated by multiplying the number by itself twice. For example, if the input is 3, then the output will be 3 * 3 * 3 = 27. In this article, we will learn …

  2. python - How to cube a number - Stack Overflow

    I have tried this with using a simple print function, you can calculate the cube by using ** operators. a = int(input()) b = int(input()) print(a**3) print(b**3)

  3. Three ways of cubing a number in python - AskPython

    Mar 16, 2023 · How to Cube a Number? There are three ways to compute the cube of a number. Using the ** operator; Using the pow() function; Creating a user-defined function; We will see …

  4. Python Program to find the cube of each list element

    Apr 28, 2023 · Use a lambda function to cube each item in the list l. The map () function applies this lambda function to each item of l and returns a new iterable with the results. Finally, the …

  5. How to find cube root using Python? - Stack Overflow

    Jan 18, 2015 · def cube(x): if 0<=x: return x**(1./3.) return -(-x)**(1./3.) print (cube(8)) print (cube(-8)) Here is the full answer for both negative and positive numbers. >>> 2.0 -2.0 >>>

  6. Create three lists of numbers, their squares and cubes using Python

    Jul 29, 2024 · The code­ includes three functions: calculate­_squares, which calculates the square­s of numbers; calculate_cubes, which calculate­s the cubes of numbers; and ge­nerate_lists, …

  7. Python Program to Calculate Cube of a Number - Tutorial …

    Write a Python Program to Calculate the Cube of a Number using Arithmetic Operators and Functions with an example. This Python program allows users to enter any numeric value. …

  8. Python Program to Generate Cube of Numbers

    Welcome back to this tutorial in this article we are going to discuss how to get a cube of any given number in Python using a while loop. This program generates all the cube numbers up to a …

  9. Python Program to Find Cube of a Number - CodingBroz

    In this post, we will learn how to find the cube of a number using Python Programming language. The number that is obtained by multiplying an integer to itself three times is known as the cube …

  10. Program to find cube of a number in python - tutorialsinhand

    Nov 13, 2022 · Python program to find cube of a number. Here we will accept a number from user as int value. We will use ** to calculate cube of the number and store it in a variable. Finally we …

  11. Some results have been removed