(Nov-15-2016, 02:21 AM)Aoleone# Wrote: Hi Guys, I'll be grateful for a bit more illustration. Just started learning python. I tried below but not so good.
A=[] N= input("Enter some numbers: ") for i in range(n): D = int(input("Enter a single number")) A.append(D) print(C)
Why all the single character variable names? Normally, single-character variables are a big flag to anyone reading your code that says "this value doesn't really matter, and it isn't used for anything important. Feel free to ignore." Wouldn't it make more sense to give them labels you can remember, like "items" or "length"? Also, what's "C", and why is it indented?
N should be passed through int(), otherwise range() will fail since it can't give a range over a string. You're doing a good job building the list, so next (AFTER the for loop) you should use something like an if statement to check if what you want is inside the list.
Unless you just want to copy/paste some code. Then feel free to use this :)
print("YES" if set(range(1, 4)).issubset(int(input("Single number please: ")) for i in range(int(input("How many items? ")))) else "NO")