list
How to calculate the sum of the modules of the array elements located after the first negative number?
We have:
import random
a = float(input("Введите число, которое будет началом диапазона случайных чисел: "))
b = float(input(" ... l numbers inside the new list to the module:
newlist = [abs(elem) for elem in newlist]
And I find the sum of all the values.
Calculating a list of Fibonacci numbers by recursion
Using recursion, I calculate the Fibonacci numbers.
I want to return a list of Fibonacci numbers of length n, but I get an e ... .append(fib(n-1) + fib(n-2))
return s
I don't understand why this is happening. Thank you in advance for your help.
How to generate a list or array in Python
I have the original random array:
np.array([0, 1, 2]).
You need to get two rows of numbers (lists or one-dimensional arrays ... _2]
Is there a faster way to generate such series of numbers m_1 and m_2 in another way, for example, using list generation?
Bold dot for list items in css
How to make a point bold and change its color in a list item using css
Search for an item in the list
Code:
users = [12390312, 12313123, 57289234, 21837129398]
userstats = 21837129398
print("Начинаю поиск")
for element in us ... to do, I tried Googling, but I didn't google anything. I'm still new to this field, maybe I don't know something, tell me :)
How do I make a formatted list output?
I can't understand one mistake:
TypeError: can only concatenate list (not "str") to list
There is a line in which various i ... ), tuple([]), but then I get this answer:
['123', '456'] and 789.
I need a result like this, but without [] these brackets.
Python: You need to add an item to the list like the insert function, without using the standard language tools
I will immediately make a reservation that I understand that it would not be worth using a snake for such purposes, but I som ... There is no code, because the very beginning of this algorithm (apparently) is the problem. I hope you will have suggestions.
I can't fix the code for the task on stepik.org
The task sounds like this:"Write a function modify_list (l), which takes as input a list of integers, removes all odd values ... e number [6].
Comrades, could you please help me, a silly novice programmer, can you tell me how to solve this embarrassment?
How to put an f-string in a list
In the process, it became necessary to create a list of templates
Example: colorpatterns = ['000000', '{}0000', '00{}00', '00 ... urns out to be empty.
Tell me how to get a template when accessing a list by index, and then apply the method to it .format()
How do I remove an item from the list without adding the items to the new list?
How do I remove an item from the names list without adding the items to the new list?
When deleting via remove, the length of ... two_cards = 0
if two_cards > 0:
w_names.append(names[i])
list1.append(two_cards)
Find adjacent nested lists in the list and merge them into a new list
Help me figure it out.
There is a main list with nested lists:
a = [[1, 6], [5, 10], [6, 7], [9, 10]]
You need to compare ... or the presence of a common element and get a new list in the format:
b = [[1, 6, 7], [5, 9, 10]]
Thank you for your help.
How can I make a two-dimensional array from a one-dimensional array?
I have an array:
b = ['Hi!', 'My name is Ivan.', 'I am beginner programier...']
I want to make this one out of it:
b = [['Hi!'], ['My name is Ivan.'], ['I am beginner programier...']]
That is, an array, where each element is an array.
How do I fix the IndexError: list index out of range error?
Given an integer array of size N that does not contain the same numbers.
Check whether its elements form an arithmetic progre ... i] != d:
flag = False
i += 1
print(d if flag else 0)
Returns an error:
IndexError: list index out of range
Adding an item to the top of a Python list
There is a function append(), but it adds an item to the end of the list, which function should I use to add it to the beginning?
For example
[10,100,55]
Добавить 5 в начало
[5,10,100,55]
Problem with deleting a list item using the remove () method, in a python loop
l_o_v = [(years,yrs), (days,dys), (hours,hrs), (minutes,mnts), (seconds,sec)] #LIST OF VALUES
for each in l_o_v:
if ea ... cause the next condition is that the list length is used.
I expect [(10, 'seconds')] instead of the received one the result.
Python. Working with text, frequency analysis, string formatting
I have a task ahead of me :
Create a txt file, insert any English-language article from
Wikipedia. Implement a ... ary array with a numeric designation of places ? And what methods can be used to replace words in the text by key and value ?
Python error IndexError: list index out of range what to do?
import datetime
import requests
from bs4 import BeautifulSoup
from bs4 import BeautifulStoneSoup
import telebot
import time
... at.id
bot.send_message(chatid, rub)
bot.polling(none_stop=True)
Python IndexError error: list index out of range
HTML, lists, bulleted list
How do I make square items round in a bulleted list?
<h2>Экспорт и импорт Австралии</h2>
<UL TYPE=" ... Новая Зеландия
</LI>
<LI TYPE ="square">
Китай
</LI>
</UL>
</UL>
How do I find out the index of a list item?
This is Python 3.7.7
mylist = ['Daria','Anton','Vlad','Kirill']
We need to find out the index of the 'Vlad' element. Help please.
C# get the List type
To enter the function, we get the IEnumerable list object, let's say List
private Type GetListType(IEnumerable list)
{
...
}
... ype GetListType(IEnumerable list)
{
return list.GetType().GetGenericArguments()[0];
}
And I can't deal with the empty one.