Sublime Forum

Pythonproblem

#1

sir I do my all best and tried to run my code in python but I put user input in array with arr=[int(x) for x in input().split()] but this show error please here some photos I solve this question and output

0 Likes

#2

Looks like you’re using python 2. In python 2 the input function evaluates the input as a python expression, it’s about equivalent to eval(input()) in python 3. You’ll want to use raw_input() in python 2 or use python 3 instead.

0 Likes