We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Introduction
- Loops
- Discussions
Loops
Loops
Sort by
recency
|
1699 Discussions
|
Please Login in order to post a comment
I'm developing a website and need assistance in adding a Python loop to my code. The loop should generate a sequence of numbers based on specific start, stop, and step values and display the results dynamically on my website. Any advice from those with experience would be highly appreciated.
n = int(input())
for i in range(0, n): print(i ** 2)
[print(x ** 2) for x in range(0, n)]
for i in range (0,n): print(i*i)
n = int(input('')) for i in range(0, n): print(i * i) i += 1
python 3
n=int(input())
square =[x**2 for x in range(n)]
for x in square: