Here's an example of Python code with a for loop that prints the numbers from 1 to 10:

for i in range(1, 11):
    print(i)

This code uses the range() function to create a sequence of numbers from 1 to 10, and then loops through each number in the sequence using the for loop. Inside the loop, the print() function is used to output each number to the console.

python code with for loop

原文地址: https://www.cveoy.top/t/topic/bcVQ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录