Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Demonstration of Python range()

# welcome to softhunt.net
# Python Program to
# show range() basics
# printing a number
print('Numbers: ')
for i in range(15):
	print(i, end=" ")
print()

# using range for iteration
print('using range for iteration: ')
l = [5, 10, 15, 20, 25]
for i in range(len(l)):
	print(l[i], end=" ")
print()

# performing sum of natural
# number
sum = 0
for i in range(1, 16):
	sum = sum + i
print("Sum of first 15 natural number :", sum)
Comment

PREVIOUS NEXT
Code Example
Python :: Concatenation of two range() functions 
Python :: extract numbers from image python 
Python :: create loop python 
Python :: list python !g 
Python :: How to Preprocess for categorical data 
Python :: parameter name in string 
Python :: How can I make portable python desktop application 
Python :: send message in every channel discord.py 
Python :: python regex exclude letters 
Python :: create multiple marks python for python 
Python :: how to aggregate and add new column 
Python :: pyxl activate sheet 
Python :: integration test python 
Python :: How do I pre-select specific values from a dynamically populated dropdown list for HTML form 
Python :: How deploy Flask application on Webfaction 
Python :: Python (cpython 2.7.16) sample 
Python :: shere point file uploading to doc repository python 
Python :: how to close python in terminal 
Python :: ring Using This in the class region as Self 
Python :: list slicing 
Python :: Python loop aray 
Python :: how to create dataframe from rdd 
Python :: raise keyerror(key) from none os.environ 
Python :: Find dataframe column values containing a certain string 
Python :: FinnT730 
Python :: Flask - store object directly in a session [duplicate] 
Python :: Shelve Data Storage 
Python :: python random number 1 100 
Python :: how to create a calculator in python 
Python :: TypeError: get() takes 1 positional argument but 2 were given 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =