Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with this code
#1
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
Reply


Messages In This Thread
Help with this code - by skriff - Aug-21-2017, 12:51 PM
RE: Help with this code - by ichabod801 - Aug-21-2017, 01:00 PM
RE: Help with this code - by skriff - Aug-21-2017, 01:24 PM
RE: Help with this code - by wavic - Aug-21-2017, 02:01 PM
RE: Help with this code - by ichabod801 - Aug-21-2017, 02:19 PM
RE: Help with this code - by Larz60+ - Aug-21-2017, 02:31 PM
RE: Help with this code - by skriff - Aug-21-2017, 04:12 PM
RE: Help with this code - by wavic - Aug-21-2017, 09:34 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020