Sort by

recency

|

1798 Discussions

|

  • + 0 comments

    Its simple syntax makes it easy to learn, while the huge library support lets you build anything from small scripts to AI and web apps. t20exchange com

  • + 0 comments

    Am I the only one that gets tripped up the wording of these questions? "The provided code stub reads an integer, n , from STDIN. For all non-negative integers i < n, print i²"

    I couldn't figure out what this was asking without help. But if it had asked:

    "The input given below, (5), is to represent n. For all index numbers in the range of n, print the square of that index number on its own line." ..or something like that. I feel like I'm spending more time trying to interpret instructions that wouldn't appear in any dev job than actually learning something useful

  • + 0 comments
    n = int(input())
    [print(i*i) for i in range(0,n)]
    
  • + 0 comments

    if name == 'main': n = int(input())

    i = list(range (0,n))
    for m in i: 
        print(m**2)
    
  • + 0 comments

    For Python3 Platform

    n = int(input())
    
    for i in range(n):
        print(i * i)