#๐ what is wrong? im new..
27 messages ยท Page 1 of 1 (latest)
@rugged karma
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.
oh sorry
wait lemme copy pand paste the code
names_list = []
people = 0
persons = int(input('how many people would you like to invite?:'))
while persons != people:
names = input('type in the names of the people.: ')
names_list.append(names)
print(names_list)
Hey @rugged karma!
It looks like you're trying to paste code into this channel.
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```py
print('Hello, world!')
```
This will result in the following:
print('Hello, world!')```
You can **edit your original message** to correct your code block.
formatedpy names_list = [] people = 0 persons = int(input('how many people would you like to invite?:')) while persons != people: names = input('type in the names of the people.: ') names_list.append(names) print(names_list)
you dont increment people so it gets stuck in a infinite loop
and you didnt use .split() on names
!epy names_list = [] names = "Ben Alice Tom Luka MellowSatella" names_list.append(names) print(names_list) #above is your code, notice how in the print its just 1 thing in the list with all the names
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['Ben Alice Tom Luka MellowSatella']
!epy names_list = [] names = "Ben Alice Tom Luka MellowSatella" names_list.extend(names.split(" ")) #.split(" ") splits the string at spaces and returns a list #.extent just extends the list, if you wouldn't do this then you would have a list inside of a list [["Ben", "Alice"...]] print(names_list)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
['Ben', 'Alice', 'Tom', 'Luka', 'MellowSatella']
thank you :]] very much
no problem
sorryyy it seems basicc
if you have any more questions feel free to message me
dont worry
learning is difficult
i didnt use a book to learn
i just watched a lot of yt videos and tried to write code
okkk
i always learn programming languages with a book. a book is definetly a good way
but of course doing a lot of programming by yourself is the key
i struggle with a lot of fonts
so i cant read books, thats why i watched yt to learn
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.