Ask coding questions

← Back to all posts
factoring
SethElder1

what is wrong here? im trying to make it show all the factors of a user inputted number

Voters
SethElder1
Comments
hotnewtop
TheDNAHero

The number that you input is a string, not a number. You need to do

I forked the repl and did it: https://replit.com/@TheDNAHero/factoring#main.py

MrVoo

@TheDNAHero Using int(input() is easy, but can look sloppy because it errors if you type a letter. Use try and except in a while loop

TheDNAHero

@MrVoo just something quick. You could do that but this is easier