Комментарии:
Thank you!
Ответить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
>>> a = 100
>>> b = 200
>>> c = 300
>>> name = [a,b,c]
>>> name
[100, 200, 300]
>>>
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
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.
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.
Ответить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
ОтветитьHow do i save the output
ОтветитьThanlks mate. I didnt catch it at class at all waht is the :
ОтветитьThis was so helpful, thank you!
ОтветитьThank you 🙏🙏🙏
Ответить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?
Ответить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.
Ответить