How to add integer elements from input to the list - Python example

preview_player
Показать описание
In this video we're going to talk about how to take elements from an input and add them to the list in Python.
Рекомендации по теме
Комментарии
Автор

Thank you bro you have clarified my doubt thank you soo munch

Praveenvv_
Автор

if I want to take both int and float inputs and then add all of the numbers in the list (both int and float)?

MySereneSounds
Автор

if i throw a dice for 1000 times, how do i store each throw result in a list? can use append?

garysee
Автор

But if I try to insert a string or a float it will give an error

AlexMoreira
Автор

This should be called add input to list "five" times.

AL-lmwg
Автор

My code is not working
list=[ ]
for i in range(5):
list.append(int(input())

print(list)

lilyloo
Автор

lis=[]
n = int (input())
for i in range(n):
lis.append(int(input()))
b=sorted(lis)
if lis == b:
print("already sorted ")
else:
print("The sorted list is {0}".format(b))

Ok_do