Skip to content

raw_input() was removed in Python 3 #485

Closed
@cclauss

Description

@cclauss

@ParthS007 #483 should be reverted!

flake8 testing of https://github.com/TheAlgorithms/Python on Python 3.7.0

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./Maths/SieveOfEratosthenes.py:2:9: F821 undefined name 'raw_input'
n = int(raw_input("Enter n: "))
        ^
./Neural_Network/perceptron.py:123:32: F821 undefined name 'raw_input'
        sample.insert(i, float(raw_input('value: ')))
                               ^
./ciphers/brute-force_caesar_cipher.py:47:15: F821 undefined name 'raw_input'
    message = raw_input("Encrypted message: ")
              ^
./ciphers/transposition_cipher_encrypt-decrypt_file.py:8:15: F821 undefined name 'raw_input'
    key = int(raw_input('Enter key: '))
              ^
./ciphers/transposition_cipher_encrypt-decrypt_file.py:9:12: F821 undefined name 'raw_input'
    mode = raw_input('Encrypt/Decrypt [e/d]: ')
           ^
./ciphers/transposition_cipher_encrypt-decrypt_file.py:16:20: F821 undefined name 'raw_input'
        response = raw_input('> ')
                   ^
./ciphers/rsa_cipher.py:9:16: F821 undefined name 'raw_input'
    response = raw_input('Encrypte\Decrypt [e\d]: ')
               ^
./ciphers/vigenere_cipher.py:5:15: F821 undefined name 'raw_input'
    message = raw_input('Enter message: ')
              ^
./ciphers/vigenere_cipher.py:6:11: F821 undefined name 'raw_input'
    key = raw_input('Enter key [alphanumeric]: ')
          ^
./ciphers/vigenere_cipher.py:7:12: F821 undefined name 'raw_input'
    mode = raw_input('Encrypt/Decrypt [e/d]: ')
           ^
./ciphers/simple_substitution_cipher.py:7:15: F821 undefined name 'raw_input'
    message = raw_input('Enter message: ')
              ^
./ciphers/simple_substitution_cipher.py:9:12: F821 undefined name 'raw_input'
    resp = raw_input('Encrypt/Decrypt [e/d]: ')
           ^
./ciphers/caesar_cipher.py:43:18: F821 undefined name 'raw_input'
        choice = raw_input("What would you like to do?: ")
                 ^
./ciphers/caesar_cipher.py:47:21: F821 undefined name 'raw_input'
            strng = raw_input("Please enter the string to be ecrypted: ")
                    ^
./ciphers/caesar_cipher.py:54:21: F821 undefined name 'raw_input'
            strng = raw_input("Please enter the string to be decrypted: ")
                    ^
./ciphers/caesar_cipher.py:56:23: F821 undefined name 'raw_int'
                key = raw_int(input("Please enter off-set between 1-94: "))
                      ^
./ciphers/caesar_cipher.py:61:21: F821 undefined name 'raw_input'
            strng = raw_input("Please enter the string to be decrypted: ")
                    ^
./ciphers/transposition_cipher.py:5:15: F821 undefined name 'raw_input'
    message = raw_input('Enter message: ')
              ^
./ciphers/transposition_cipher.py:6:15: F821 undefined name 'raw_input'
    key = int(raw_input('Enter key [2-%s]: ' % (len(message) - 1)))
              ^
./ciphers/transposition_cipher.py:7:12: F821 undefined name 'raw_input'
    mode = raw_input('Encryption/Decryption [e/d]: ')
           ^
./ciphers/affine_cipher.py:7:15: F821 undefined name 'raw_input'
    message = raw_input('Enter message: ')
              ^
./ciphers/affine_cipher.py:8:15: F821 undefined name 'raw_input'
    key = int(raw_input('Enter key [2000 - 9000]: '))
              ^
./ciphers/affine_cipher.py:9:12: F821 undefined name 'raw_input'
    mode = raw_input('Encrypt/Decrypt [E/D]: ')
           ^
./Graphs/scc_kosaraju.py:3:21: F821 undefined name 'raw_input'
n, m = list(map(int,raw_input().split()))
                    ^
./Graphs/scc_kosaraju.py:9:25: F821 undefined name 'raw_input'
    u, v = list(map(int,raw_input().split()))
                        ^
./Graphs/MinimumSpanningTree_Prims.py:104:9: F821 undefined name 'raw_input'
n = int(raw_input("Enter number of vertices: "))
        ^
./Graphs/MinimumSpanningTree_Prims.py:105:9: F821 undefined name 'raw_input'
e = int(raw_input("Enter number of edges: "))
        ^
./Graphs/minimum_spanning_tree_kruskal.py:2:37: F821 undefined name 'raw_input'
num_nodes, num_edges = list(map(int,raw_input().split()))
                                    ^
./Graphs/minimum_spanning_tree_kruskal.py:7:36: F821 undefined name 'raw_input'
	node1, node2, cost = list(map(int,raw_input().split()))
                                   ^
./boolean_algebra/Quine_McCluskey/QuineMcCluskey.py:102:23: F821 undefined name 'raw_input'
	no_of_variable = int(raw_input("Enter the no. of variables\n"))
                      ^
./boolean_algebra/Quine_McCluskey/QuineMcCluskey.py:103:30: F821 undefined name 'raw_input'
	minterms = [int(x) for x in raw_input("Enter the decimal representation of Minterms 'Spaces Seprated'\n").split()]
                             ^
./data_structures/Graph/FloydWarshall.py:33:9: F821 undefined name 'raw_input'
V = int(raw_input("Enter number of vertices: "))
        ^
./data_structures/Graph/FloydWarshall.py:34:9: F821 undefined name 'raw_input'
E = int(raw_input("Enter number of edges: "))
        ^
./data_structures/Graph/FloydWarshall.py:43:12: F821 undefined name 'raw_input'
	src = int(raw_input("Enter source:"))
           ^
./data_structures/Graph/FloydWarshall.py:44:12: F821 undefined name 'raw_input'
	dst = int(raw_input("Enter destination:"))
           ^
./data_structures/Graph/FloydWarshall.py:45:17: F821 undefined name 'raw_input'
	weight = float(raw_input("Enter weight:"))
                ^
./data_structures/Graph/Dijkstra.py:41:9: F821 undefined name 'raw_input'
V = int(raw_input("Enter number of vertices: "))
        ^
./data_structures/Graph/Dijkstra.py:42:9: F821 undefined name 'raw_input'
E = int(raw_input("Enter number of edges: "))
        ^
./data_structures/Graph/Dijkstra.py:51:12: F821 undefined name 'raw_input'
	src = int(raw_input("Enter source:"))
           ^
./data_structures/Graph/Dijkstra.py:52:12: F821 undefined name 'raw_input'
	dst = int(raw_input("Enter destination:"))
           ^
./data_structures/Graph/Dijkstra.py:53:17: F821 undefined name 'raw_input'
	weight = float(raw_input("Enter weight:"))
                ^
./data_structures/Graph/Dijkstra.py:56:12: F821 undefined name 'raw_input'
gsrc = int(raw_input("\nEnter shortest path source:"))
           ^
./data_structures/Graph/BellmanFord.py:38:9: F821 undefined name 'raw_input'
V = int(raw_input("Enter number of vertices: "))
        ^
./data_structures/Graph/BellmanFord.py:39:9: F821 undefined name 'raw_input'
E = int(raw_input("Enter number of edges: "))
        ^
./data_structures/Graph/BellmanFord.py:48:12: F821 undefined name 'raw_input'
	src = int(raw_input("Enter source:"))
           ^
./data_structures/Graph/BellmanFord.py:49:12: F821 undefined name 'raw_input'
	dst = int(raw_input("Enter destination:"))
           ^
./data_structures/Graph/BellmanFord.py:50:17: F821 undefined name 'raw_input'
	weight = float(raw_input("Enter weight:"))
                ^
./data_structures/Graph/BellmanFord.py:53:12: F821 undefined name 'raw_input'
gsrc = int(raw_input("\nEnter shortest path source:"))
           ^
./Project Euler/Problem 07/sol2.py:7:9: F821 undefined name 'raw_input'
n = int(raw_input('Enter The N\'th Prime Number You Want To Get: ')) # Ask For The N'th Prime Number Wanted
        ^
./Project Euler/Problem 07/sol1.py:19:9: F821 undefined name 'raw_input'
n = int(raw_input())
        ^
./Project Euler/Problem 04/sol2.py:15:7: F821 undefined name 'raw_input'
n=int(raw_input())
      ^
./Project Euler/Problem 04/sol1.py:7:13: F821 undefined name 'raw_input'
limit = int(raw_input("limit? "))
            ^
./Project Euler/Problem 06/sol2.py:12:9: F821 undefined name 'raw_input'
n = int(raw_input())
        ^
./Project Euler/Problem 06/sol1.py:15:9: F821 undefined name 'raw_input'
n = int(raw_input())
        ^
./Project Euler/Problem 16/sol1.py:1:13: F821 undefined name 'raw_input'
power = int(raw_input("Enter the power of 2: "))
            ^
./Project Euler/Problem 20/sol1.py:18:14: F821 undefined name 'raw_input'
number = int(raw_input("Enter the Number: "))
             ^
./Project Euler/Problem 02/sol3.py:10:9: F821 undefined name 'raw_input'
n = int(raw_input())
        ^
./Project Euler/Problem 03/sol2.py:7:7: F821 undefined name 'raw_input'
n=int(raw_input())
      ^
./Project Euler/Problem 03/sol1.py:22:7: F821 undefined name 'raw_input'
n=int(raw_input())
      ^
./Project Euler/Problem 09/sol2.py:9:9: F821 undefined name 'raw_input'
N = int(raw_input())
        ^
./Project Euler/Problem 08/sol1.py:4:12: F821 undefined name 'raw_input'
    number=raw_input().strip()
           ^
./Project Euler/Problem 05/sol2.py:16:9: F821 undefined name 'raw_input'
n = int(raw_input())
        ^
./Project Euler/Problem 05/sol1.py:8:9: F821 undefined name 'raw_input'
n = int(raw_input())
        ^
./Project Euler/Problem 13/sol1.py:7:9: F821 undefined name 'raw_input'
n = int(raw_input().strip())
        ^
./Project Euler/Problem 13/sol1.py:11:22: F821 undefined name 'raw_input'
    array.append(int(raw_input().strip()))
                     ^
./other/nested_brackets.py:40:9: F821 undefined name 'raw_input'
    S = raw_input("Enter sequence of brackets: ")
        ^
./other/tower_of_hanoi.py:22:18: F821 undefined name 'raw_input'
    height = int(raw_input('Height of hanoi: '))
                 ^
./machine_learning/perceptron.py:123:32: F821 undefined name 'raw_input'
        sample.insert(i, float(raw_input('value: ')))
                               ^
./machine_learning/logistic_regression.py:19:1: F821 undefined name 'get_ipython'
get_ipython().run_line_magic('matplotlib', 'inline')
^
69    F821 undefined name 'raw_input'
69

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions