Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Persistance of a number only one greater than 4 from 10-100
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
munt4life




PostPosted: Sun Oct 09, 2011 6:52 pm   Post subject: Persistance of a number only one greater than 4 from 10-100

The persistance is a the number of times the product of a number is carried out ex.
56 becomes 5*6 30 becomes 3*0 becomes 3 so the persistance is 2
53~~~15~~~~5

So how do i find the persistance of a number greater than 3 from 10-100 i know its 77, i have to make a program like this so i have

abc=False
per=0
for i in range (1,100):

if (i/10)*(i%10) > 9:
abc==True
per=1
if abc==True:
i/10 * i%10
per+=1
if per<3:
print i


but im not really getting anything like this. please give me some tips
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Oct 09, 2011 7:01 pm   Post subject: Re: Persistance of a number only one greater than 4 from 10-100

munt4life @ Sun Oct 09, 2011 6:52 pm wrote:
56 becomes 5*6 30 becomes 3*0 becomes 3 (did you mean 0?) so the persistance is 2

Easy. Persistence of 56 is 1 + persistence of 30.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: