Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def entree_liste():
- liste_entier = []
- liste_nombre = int(input("Enter list of number separate by space :"))
- for chiffre in range(liste_nombre):
- liste_entier.append(chiffre)
- print(liste_entier)
- liste_nombre = int(input("Enter list of number separate by space :"))
- ValueError: invalid literal for int() with base 10: '22 33 44 55'
- # get list as string
- list_nombre = input("Enter list of numbers separated by space:")
- # create list of smaller strings, each with one integer-as-string
- list_of_int_strings = list_nombre.split(' ')
- # convert list of strings to list of integers
- list_of_ints = []
- for int_string in list_of_int_strings:
- list_of_ints.append(int(int_string)
- list_nombre = input("Enter list of numbers separated by space:")
- list_of_ints = ([int(s) for s in list_nombre.split(' ')])
- liste_entier = list(map(int, input("Enter list of number separate by space :").split()))
- list_nombre = input("Enter list of numbers separated by space:")
- list_of_ints = [int(s) for s in list_nombre.split()]
- def convert_int(s):
- try:
- return int(s)
- except ValueError as e:
- print e
- return None
- list_nombre = input("Enter list of numbers separated by space:")
- list_of_ints = [convert_int(s) for s in list_nombre.split()]
- input = raw_input("Enter list of number separate by space :")
- input.split()
- string = input('Enter list of space separated numbers: ')
- numbers = [int(n) for n in string.split() if n.isdigit()]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement