About 137,000 results
Open links in new tab
  1. python - Equivalent of "for X in [list]" or "foreach" - Mathematica ...

    Sep 12, 2017 · In Python, we can evaluate an expression over specific values of x in a list. Example: print a[i] # should print a[] elements. Many other languages call this operation …

  2. How to divide with a loop? (Python) - Stack Overflow

    Sep 19, 2014 · I want to do the following: take the number x and divide it by every number that is less than itself. If any solution equals zero, print 'Not prime.' If no solution equals zero, print …

  3. For loop within a function in Mathematica - Stack Overflow

    Feb 23, 2013 · If you really want a For loop : func[r_,f_]:=(temp=0;For[ ...,temp+= .. ] ; temp) You can RTFM the For[] syntax, I dont think I've ever used it but it looks like "c"

  4. Times—Wolfram Language Documentation

    Divide gives the division of two expressions. Multiplication of a function over a range or list of arguments is done using the function Product . Other types of multiplication include Dot (for …

  5. Looping Constructs—Wolfram Language Documentation

    Looping is a core concept in programming. The Wolfram Language provides powerful primitives for specifying and controlling looping, not only in traditional procedural programming, but also …

  6. no explicit loop to calculate product of list to some modulo in ...

    In Mathematica, do I have to use an explicit loop to calculate the product of elements in a given list (potentially very long) modulo to another number? Please teach me your elegant approach …

  7. How to divide one list into 2 using a For loop? - Mathematica

    Nov 1, 2018 · Say I have a list called A and I want to divide it into two separate list B and C by looping through A and picking out one element to add to B and one to add to A throughout the …

  8. Custom Division with lists - Mathematica Stack Exchange

    Dec 13, 2017 · I have some lists of data that I need to divide by each-other, but my problem is that for some values the denominator is zero. Now these particular values are not very …

  9. for loop - Python: mathematical operations - Stack Overflow

    Oct 5, 2022 · They introduce three numbers x, y and z and you want the division to output (x / y)/ z. Then you can just loop over the values in your list: div = num [0] for i in range (1, len (num)): …

  10. For loop with a multiple line body only executes the first

    I have a simple For [] loop: zPotential = 0; xPos = rDistance Cos[rPos]; yPos = rDistance Sin[rPos]; zPos = planeDepth; AppendTo[zField, {xPos,yPos, zPos, zPotential}]; . I know that …

Refresh