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
|
1798 Discussions
|
Please Login in order to post a comment
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
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
if name == 'main': n = int(input())
For Python3 Platform