#๐Ÿ”’ need help with a task (new to coding)

73 messages ยท Page 1 of 1 (latest)

proven mantle
#

please help me with this bug in this task

forest hingeBOT
#

@proven mantle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

proven mantle
#
word = []
while True:
    new_word = input("Word: ")
    word_checker = new_word
    if word_checker in word:
        break
sivert = len(word)
print (f"You typed in {sivert} words")
#

it's supposed to break the loop after you type in 2 of the same words

glass basalt
#

so you will need to update word for every iteration

proven mantle
#

OHH

#

I forgot

glass basalt
#

all g lol

proven mantle
#

why did you delete?

glass basalt
#

forget what i just said

proven mantle
#

yeah I would need to count

glass basalt
#

i read it wrongly

proven mantle
#

don't I need to count?

glass basalt
proven mantle
glass basalt
proven mantle
#
word = []
while True:
    new_word = input("Word: ")
    word_checker = new_word
    if word_checker in word:
        break
    word.append (new_word)
sivert = len(word)
print (f"You typed in {sivert} words")
glass basalt
proven mantle
#

it still doesn't work hmm

proven mantle
glass basalt
#

hm

#

is it for a project

#

maybe try removing the string in the input

proven mantle
#

what

#

wdym remove the string in the input

glass basalt
#

so just use


    new_word = input()
#

is it possible to see the error?

proven mantle
#

no

#

this is my code now, and it prints out "Word:" for some reason

#
word = []
while True:
    new_word = input()
    word.append (new_word)
    if new_word in word:
        break
sivert = len(word)
print (f"You typed in {sivert} words")
proven mantle
glass basalt
#

uhm

#

yea youll need to give it some input

#

is this for a coding problem or a self project

proven mantle
#

self project

glass basalt
#

ok so

#

your code should work

proven mantle
glass basalt
#

so with the input() function

proven mantle
#

but I do it in my free time

glass basalt
#

so

#

try typing something in the console

#

or terminal

#

and type a repeat of it

proven mantle
#

whle the code is running?

glass basalt
#

yep

proven mantle
#

it just loops

glass basalt
#

try typing the same thing again

#

bro i hate discord stickers

proven mantle
#

dude

#

it literally just loops

glass basalt
#

hm

#

can you add print(word) one line under the loop

proven mantle
#

huh

#

it doesn't print it out

#

let me restart my visual studio code

glass basalt
#

yeayea

proven mantle
#

bruh

glass basalt
#
word = []
while True:
    new_word = input()
    if new_word in word:
        break
    else:
        word.append(new_word)
sivert = len(word)
print (f"You typed in {sivert} words")
proven mantle
#

now its updated

glass basalt
#

this works for me

glass basalt
#

is it working now?

proven mantle
#

ye

#

thanks

#

VSC is so good

#

!close

forest hingeBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.