[Solved] While Loop and if statement


This should do:

import random

num = random.randint(7, 14)
print num

message = ""
prevnum = -1
for n in range(num):
    newnum = random.randint(100, 103)
    while newnum == prevnum:
        newnum = random.randint(100, 103)
    prevnum = newnum
    message += chr(newnum)

You have made numerous mistakes in your code, you should review them.

solved While Loop and if statement