Ask coding questions

← Back to all posts
How to count in python?
Richard14

How can I count in python please help me

Voters
JannatulChowdhu
ellaeo
John_WardWard
Richard14
Comments
hotnewtop
DakshilGiridhar

yes

John_WardWard

@Richard14 There is an easy way to do this: create a variable called count_up_to(10 in my piece of code at first:
count_up_to=10

Then create a for loop which will print x, as shown below.

If you would like it to count backwards from 0 , multiply x by -1 shown below:

Remember to add 1 to the variable count_up_to more than what you would like the console to count up to , as it will count from 0 inclusive.

Here is an example repl if you would like to know more.

WikingGaffa

You need to be more specific. What is it you want to count?
There is propably better ways to do it, but here is two examples

Geocube101

What do you mean 'count'? Like a for loop?