About 1,340,000 results
Open links in new tab
  1. For loop Difference Between Python and Java - Stack Overflow

    Apr 20, 2019 · In Python we do for loop like: for i in range (len (nums)) In java: we have: for (int i = 0; i < nums.length; i++) Are these two for loop identical? If we made some change within the …

  2. Why does the "for" loop work so different from other languages ... - Reddit

    Feb 16, 2022 · Both Java and C++ have for (type item: array) which is exactly the same as the Python version. Python simply lacks the more basic C-like construct, because it's simple …

  3. Java vs Python: Basic Python for Java Developers – Real Python

    The Python for loop is similar to the Java for-each loop. This means that if you want to iterate over a list of the first five Roman numerals, for example, you could code it using a similar logic:

  4. Understanding the Differences Between For Loops in Python and Java

    Explore the key differences between for loops in Python and Java, along with examples and common mistakes.

  5. The Ultimate Guide to For Loops in Java, JavaScript, and Python

    For loops are fundamental constructs in programming, allowing us to iterate over collections, perform tasks repeatedly, and control the flow of our code. In this comprehensive guide, we’ll...

  6. 1.7. Loops and IterationJava for Python Programmers

    In Python the for loop can also iterate over any sequence such as a list, a string, or a tuple. Java also provides a variation of its for loop that provides the same functionality in its so called for …

  7. Java vs Python - Loyola University Chicago

    In Python 2.X the / operator is even trickier than in Java, since you cannot tell necessarily by static analysis whether both operands are int's causing integer arithmetic to be done. You can also …

  8. Python vs Java: Differences and Similarities in 9 Key Areas

    Nov 4, 2024 · But other than that, prepare for a comprehensive fact-based rundown of the differences between Python and Java in nine key areas. 1. Python vs Java: Use Cases and …

  9. For loop in Programming - GeeksforGeeks

    May 17, 2024 · For loop is one of the most widely used loops in Programming and is used to execute a set of statements repetitively. We can use for loop to iterate over a sequence of …

  10. What is Python's equivalent of Java's standard for-loop?

    Jul 2, 2013 · In a Java for loop, the step (the i += 2 part in your example) occurs at the end of the loop, just before it repeats. Translated to a while, your for loop would be equivalent to: if (n % i …

  11. Some results have been removed
Refresh