answersLogoWhite

0


Best Answer

For the first 5 natural numbers (integers):

x = 1 + 2 + 3 + 4 + 5

print x

For 'n' amount of natural numbers (Python v2 example)

n = int(raw_input('Enter max integer: '))

count = 0

sumn = 0

while count < n:

sumn = sumn + 1

count = count + 1

print sumn

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Code for sum of first natural numbers in python language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why is python an object oriented programming language?

I suspect you mean, "What makes Python an OO language?" Well, first of all, you can define objects. But, way beyond that, all of the data types are objects, as well as methods and functions.


What is pythan language?

Python Language: Python is a widely-used programming language that was created by Guido van Rossum and first released in 1991. It is known for its clear and concise syntax, making it easy to learn and write code in. Python is an interpreted language, which means it does not require compilation before running, making it highly accessible for beginners. It is open-source and has a vast standard library and a large community, contributing to its popularity. Python is used for a wide range of applications, including web development, data science, machine learning, scientific computing, automation, and more. If you are interested in learning more about Python or gaining expertise in this language, &quot;Achieversit&quot; can provide training and resources to help you excel in your Python programming journey.


Who created the Python programming language?

#LMGTFY Guido van Rossum, a Dutch computer programmer is the author of the programming language Python. Among Python programmers and the Python community, van Rossum us known as the "Benevolent Dictator For Life" (BDFL).


How. to. write an. algorthim. to find the. sum of. first. 15 natural. numbers?

Write an. Algorthim. To. Find the. Sum. Of. First15 natural. Numbers


What is best programming language to learn first?

There is no single best language to learn first. A variety of languages could be proposed as a first language, and most of them have been. If you only want to do one thing, you can just start with the language you want to use for that purpose (JavaScript for web, Objective-C for iPhone apps, etc.). For learning to program, in general I think that Python is a good first language, as it is simple, powerful, and popular. Peter Norvig, Director of Research at Google, recommends Python or Scheme. Trevor Blackwell, a Silicon Valley entrepreneur, recommends Python. Eric Raymond, a noted programmer and open-source advocate, also recommends Python as a starting language. The idea behind recommending Python and similar languages is that the beginning programmer can spend more time thinking about what they actually want to accomplish, and less about the details of Java or C++ (e.g. "public static void main(String[] args)"). Also, despite being easy to learn, Python is a language that is actually used (by Google and NASA, for example).

Related questions

What is the best first computer language to learn?

Python is good. But not if you wont to build on that language as python is pretty much python only, as well as pygame which is fun.


Should you learn any of the C languages first or should you learn Python first?

Knowing C (or indeed any other language) will make learning Python slightly easier but Python is an easy language to begin with. Therefore learn Python first. Also, it's best to learn C++ before learning C.


When was the first python array written?

Python is a high level computer programming language. It allows programmers to use clearer code with fewer lines that other languages. A Python array is a method to store data. Whilst it is impossible to precisely date when the first python array was written, development work started on the language in December 1989.


What is the smallest multiple of the first ten natural numbers?

2520 is the smallest multiple of of first ten natural numbers.


Why is python an object oriented programming language?

I suspect you mean, "What makes Python an OO language?" Well, first of all, you can define objects. But, way beyond that, all of the data types are objects, as well as methods and functions.


What is the sum of 50 natural numbers?

The sum of the first 50 natural numbers is 1,251.


What is eaten by a Python?

a hippo. go to you-tube and type in python eats hippo and click on the first one that pops up and see for yourself. its in a different language though


The variance of first n natural numbers is?

1 Sum of first n natural numbers = n(n+1)2[Formula.]2 Arthmetic mean of first n natural numbers = Sum of the numbers n[Formula.]3 = n(n+1)2n = n+124 So, the Arthmetic mean of first n natural numbers = n+12


What is pythan language?

Python Language: Python is a widely-used programming language that was created by Guido van Rossum and first released in 1991. It is known for its clear and concise syntax, making it easy to learn and write code in. Python is an interpreted language, which means it does not require compilation before running, making it highly accessible for beginners. It is open-source and has a vast standard library and a large community, contributing to its popularity. Python is used for a wide range of applications, including web development, data science, machine learning, scientific computing, automation, and more. If you are interested in learning more about Python or gaining expertise in this language, &quot;Achieversit&quot; can provide training and resources to help you excel in your Python programming journey.


What is sum of natural numbers between 200?

The sum of the first 200 natural numbers is 20,001.


What is the product of the first five natural numbers?

Good question. 1+2+3+4+5=155=15 So the product of first five natural numbers is fifteen Natural numbers starts from one So we add first five natural numbers and get the right answer is fifteen


What is the first natural numbers?

123456789101112131415.