+ 1
Can you help me with this code please?
Coding question https://code.sololearn.com/csHZc160R7V3/?ref=app
22 Answers
+ 3
Pooja Patel ,
the code you have posted here looks 100% identical to a post from @Pusparasa Ayilavan that he has posted one month ago in the current post.
> did you just copy and paste it ???
+ 2
ok - i found it:
Given a list of numbers, output "bingo" if it contains the input number.
Do not output anything if the number is not found.
so the code could be like:
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input())
if num in x:
print('bingo')
doing it with a for loop:
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
for lst_num in x:
if num == lst_num:
print('bingo')
+ 2
items = [42, 88, 721, 12, 43, 22, 908]
num = int(input())
#your code goes here
for lst_num in items:
if num == lst_num:
print('bingo')
+ 2
this should work:
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input())
if num in x:
print ("bingo")
+ 2
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input( ) )
if num in x:
print( "bingo" )
is also right answer
+ 1
The following should work... :D
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input())
if num in x:
print ("bingo")
+ 1
You can write like this also
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input())
if num in x:
print("bingo")
else:
print()
0
Comment or remove 2nd line of taking user input.
What are you trying with this code? pls add more details...
0
num = int(input())
if num in x:
print ("bingo")
0
items = [42, 88, 721, 12, 43, 22, 908]
num = int(input())
#your code goes here
for lst_num in items:
if num == lst_num:
print('bingo')
0
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input( ) )
if num in x:
print( "bingo" )
- 1
Emma Cooke ,
please specify the name of the python tutorial , also the lesson / exercise number. to give qualified help, we need to see the task description.
thanks!
- 1
Change your second lines variable name as num becoz you used same variable name for both the lines python takes the last variable name so you have stucked .Hope this info helps all.
- 1
list=[21,34,56,27,85,67,45]
print('My list is ',list)
n=int(input('Enter any number: '))
for i in range(0,len(list)):
if(list[i]==n):
print('Bingo')
- 1
Can try this
items = [42, 88, 721, 12, 43, 22, 908]
num = int(input())
if num == items[0] or num == items[1] or num == items[2] or num == items[3] or num == items[4] or num == items[5] or num == items[6]:
print("bingo")
- 1
its becoz you havent completed the course before it . I am also using the free course
- 2
I'm not sure tbh. I'm new to this so it's all trial and error. Just trying it for a bit of fun.
- 2
or You can solve like this
items = [42, 88, 721, 12, 43, 22, 908]
num = int(input())
if num == items[0]:
print("bingo")
elif num == items[1]:
print("bingo")
elif num == items[2]:
print("bingo")
elif num == items[3]:
print("bingo")
elif num == items[4]:
print("bingo")
elif num == items[5]:
print("bingo")
elif num == items[6]:
print("bingo")
- 2
x = [42, 8, 7, 1, 0, 124, 8897, 555, 3, 67, 99]
num = int(input())
if num in x:
print('bingo')
done...!
- 3
says to activte my account to use ‘messenger’; how on earth do I do that, received no such email.