Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

sum of even numbers

# Python Program to Calculate Sum of Even Numbers from 1 to N
 
maximum = int(input(" Please Enter the Maximum Value : "))
total = 0

for number in range(1, maximum+1):
    if(number % 2 == 0):
        print("{0}".format(number))
        total = total + number

print("The Sum of Even Numbers from 1 to {0} = {1}".format(number, total))
Comment

Sum of odd numbers

function rowSumOddNumbers(n) {
  return Math.pow(n, 3);
}
Comment

PREVIOUS NEXT
Code Example
Python :: unknown amount of arguments discord py 
Python :: len dictionary python 
Python :: sorted multiple keys python 
Python :: python math packege power e 
Python :: what does the .item() do in python 
Python :: palindrome of a number in python 
Python :: Exception in thread 
Python :: django password hashing 
Python :: python list comprehensions 
Python :: create django object 
Python :: pivot table pandas 
Python :: python modulo 
Python :: what is a python module 
Python :: python declare variable 
Python :: python iterating through a list 
Python :: string slicing python 
Python :: python find length of list 
Python :: python import statement 
Python :: numpy datatime object 
Python :: duplicate remove 
Python :: pandas drop columns 
Python :: multivaluedictkeyerror django 
Python :: sessions in flask 
Python :: create a new column in pandas dataframe based on the existing columns 
Python :: How to swap elements in a list in Python detailed 
Python :: or in if statement python 
Python :: gui in python 
Python :: python exit if statement 
Python :: python return multiple value from a function 
Python :: how to use variable from another function in python 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =