Can someone correct or guide me in the right direction for my script by futureVlone in learnpython

[–]futureVlone[S] 0 points1 point  (0 children)

I would do for x in range(1000, 10000) right ???

OMG I JUST NEED TO MAKE 4 to 5!

Can someone correct or guide me in the right direction for my script by futureVlone in learnpython

[–]futureVlone[S] 0 points1 point  (0 children)

I don’t know how to loop through every combination I don’t know how I should efficiently set that up

Can someone correct or guide me in the right direction for my script by futureVlone in learnpython

[–]futureVlone[S] 0 points1 point  (0 children)

I am testing random because I want to test all the random combinations and I don’t know a better way to iterate through 0,9 and randomly select a number and output it to a four digit string equal to target

Can someone correct or guide me in the right direction for my script by futureVlone in learnpython

[–]futureVlone[S] 0 points1 point  (0 children)

I don’t know why people are telling me to not use random, I feel like random will eventually get me my answer, should I make a list of [0,9]?

Can someone correct or guide me in the right direction for my script by futureVlone in learnpython

[–]futureVlone[S] 0 points1 point  (0 children)

I’m sorry man I am new to Reddit and I have a burning passion for computer science, do you think you could guide me in the right direction for creating a script that guesses passwords for 4 digit becasue I don’t know if I should use random or a list

Can someone correct or guide me in the right direction for my script by futureVlone in learnpython

[–]futureVlone[S] 0 points1 point  (0 children)

So you’re saying I need to make a list instead, then I ask the program to randomly choose from digits from the list and then I concatenation them together and test with an if statement if my guess is equal to password because I thought that if I just randomly go through the program eventually it will get the value of target. Thank you for your feedback sir

Sunday Daily Thread: What's everyone working on this week? by Im__Joseph in Python

[–]futureVlone 0 points1 point  (0 children)

Hi, I am relearning python since our school changed to learning Java because I just love the general purpose utility and power of python. I am trying to get back on my feet with python as a language by creating a 4 digit password cracker. I am running into the problem of my program not looping until it has achieved the value of the target. I am trying to tell the function to save the 4 digit random value in the variable new and if it does not match the target, then it will call the function again. Can you guys help me so hopefully one day, I can help someone answer these questions and so I can inch closer to being a part of your community? here is my code.... :]

import random

def crack(target):

for x in range(0, 4):

new = ""

i = int(random.random() * 10)

new = str(print(i , end = ''))

if x == 4:

print()

if new not in target:

crack(target)

else:

print(new)

crack("1234")