Lists and Using List Index in Python (Python for Beginners) | Part 15

Lists and Using List Index in Python (Python for Beginners) | Part 15

Max Goodridge

8 лет назад

18,880 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@emana9868
@emana9868 - 12.12.2017 00:03

Thank you!

Ответить
@wolfgangplato8593
@wolfgangplato8593 - 01.03.2018 20:34

Anyone any idea how to rewrite "words1 = [self._word_to_id.keys()[self._word_to_id.values().index(data_x[index])] for index in range(len(puncts) - 1)]" to correct Python 3 syntax?
The .index() method is not valid syntax in python 3 anymore

Ответить
@simranjit473
@simranjit473 - 22.05.2018 01:54

>>> a = 100
>>> b = 200
>>> c = 300
>>> name = [a,b,c]
>>> name
[100, 200, 300]
>>>

Ответить
@MrAbdulaziz05
@MrAbdulaziz05 - 11.06.2018 12:14

hi max, thanks for the video, i was playing around with my python shell today and i was trying to assign a list members with a loop, it gives me out of range error
my code .

>>> i = []
>>> for j in range(100):
i[j] = j


Traceback (most recent call last):
File "<pyshell#63>", line 2, in <module>
i[j] = j
IndexError: list assignment index out of range

Ответить
@sasso6362
@sasso6362 - 30.08.2018 06:37

How would you put all the names in a single row, one name per column and above each name print its index number; So 2 rows and 4 columns?
Or if there is a list of numbers, 0-9, and a list of letters, a-j, how would you print the numbers in one row, one number per column and print the letters in another row, one letter per column, so that the numbers are above the letters in a table?
Answer = input("Do you know what you are doing?:")
For row in range 2
For col in range 10
If Answer == "Yes":
Print ("Your good to go.")
Else:
Answer == "No"
Print ('Help!')
>>error
Traceback: invalid syntax line 5.

Ответить
@justinunion7586
@justinunion7586 - 25.04.2019 02:17

Thank you for explaining this in an easy way to understand. Young people today always impress me with how much intuitive sense they have with computer language.

Ответить
@FRIENDSofCAP
@FRIENDSofCAP - 04.08.2019 14:39

Just a point of correction... You can use mulitple data types in a list object. I just did it. I am using python 3.7.4

Ответить
@Dopeboyz789
@Dopeboyz789 - 06.08.2019 11:38

How do i save the output

Ответить
@MrMaister
@MrMaister - 05.04.2020 15:32

Thanlks mate. I didnt catch it at class at all waht is the :

Ответить
@roxysomi6320
@roxysomi6320 - 10.09.2020 11:20

This was so helpful, thank you!

Ответить
@techroyale8516
@techroyale8516 - 06.12.2020 21:19

Thank you 🙏🙏🙏

Ответить
@mya5683
@mya5683 - 25.01.2021 17:57

How do you utilize the input function with a list? Say you have a list of names stored with the variable. You ask user input for their name and you need it to output that individuals name. How does the computer select the name of you have not given it an index number? Basically how can you utilize input function and have the computer pull from the list based off the user input?

Ответить
@b5banna
@b5banna - 19.05.2021 03:51

Pretty sad when I cant even get an answer out of my professor but come to this legends video and he assists me in solving my problem. Thank you so much.

Ответить