Hi, I'm new to python so I'm asking a noob question.
I'm given a large string from which I have to take all the digits and check if its prime or not. Then I have to take the first 25 chars of the string and append the prime digits to it. How am I supposed to do it ?
np complete 8 Newbie Poster
Recommended Answers
Jump to PostSome help ...
prime numbers are only divisible by unity and themselves
integers less than 2 and even numbers other than 2 are not prime
Jump to PostWhy did you declare i = "" ? Python cannot add a str to an int.
All 8 Replies
Gribouillis 1,391 Programming Explorer Team Colleague
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
james.lu.75491856 0 Junior Poster
np complete 8 Newbie Poster
np complete 8 Newbie Poster
Gribouillis 1,391 Programming Explorer Team Colleague
np complete 8 Newbie Poster
Gribouillis 1,391 Programming Explorer Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.