From 6fa3d1698d6cdef1dcb1e6b25ec4bbdb86df773d Mon Sep 17 00:00:00 2001 From: cclauss Date: Sat, 21 Jul 2018 15:58:28 +0200 Subject: [PATCH] import random to access random.randint() These kind of errors should be automatically detected by #218 flake8 testing of https://github.com/TheAlgorithms/Python on Python 3.6.3 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./ciphers/Onepad_Cipher.py:11:17: F821 undefined name 'random' k = random.randint(1, 300) ^ 1 F821 undefined name 'random' 1 ``` --- ciphers/Onepad_Cipher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ciphers/Onepad_Cipher.py b/ciphers/Onepad_Cipher.py index 5536285efc17..7e1be5fdc077 100644 --- a/ciphers/Onepad_Cipher.py +++ b/ciphers/Onepad_Cipher.py @@ -1,5 +1,7 @@ from __future__ import print_function +import random + class Onepad: def encrypt(self, text):