#๐ need help with a task (new to coding)
73 messages ยท Page 1 of 1 (latest)
@proven mantle
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.
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
so you will need to update word for every iteration
all g lol
why did you delete?
forget what i just said
yeah I would need to count
i read it wrongly
don't I need to count?
2 of the same words right so thats one repeition?
oh yeah I'm stupid
yea yea so everything looks good just update the list
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")
and you also do not need the extra variable word checker
it still doesn't work hmm
yeah I'll just use new_word
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")
whats the input
its empty
uhm
yea youll need to give it some input
is this for a coding problem or a self project
self project
or its an online course
but I do it in my free time
oh ok
so
try typing something in the console
or terminal
and type a repeat of it
whle the code is running?
yep
it just loops
yeayea
bruh
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")
now its updated
this works for me
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.