Aug-21-2017, 12:51 PM
Im kinda a newbie with programation.
i've been asked to make a program which generates all the possible ASCII combinations up to 8 characters.
ive been working with c++ but i'd like to learn python. so how would this look in python language?
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
main(){
int siz;
printf("password lenght?");
scanf("%i",&tam);
if (siz==1){
for (int i=0; i<256;i++){
printf("%c\n",i);
}
}
if(siz==2){
for(int i=0; i<256;i++){
for(int j=0; j<256;j++)
printf("%c%c\n",i,j);
}
}
}
its just repeating those cycles until siz reaches 8
i've been asked to make a program which generates all the possible ASCII combinations up to 8 characters.
ive been working with c++ but i'd like to learn python. so how would this look in python language?
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
main(){
int siz;
printf("password lenght?");
scanf("%i",&tam);
if (siz==1){
for (int i=0; i<256;i++){
printf("%c\n",i);
}
}
if(siz==2){
for(int i=0; i<256;i++){
for(int j=0; j<256;j++)
printf("%c%c\n",i,j);
}
}
}
its just repeating those cycles until siz reaches 8