print(' Add elements to the list ( Input “#” end )\n And see the added list ')
list1=[]
while 1:
username=input('>>>')
if (username.strip() =="#"):
break
else:
list1.append(username)
print(list1)

The basic method of looping input to the list -----python----- More articles about

  1. Use while Loop to process lists and dictionaries —— Reference resources Python Programming from entry to practice

    1. Move elements between lists unconfirmed_users = ['alice', 'brian', 'candace'] confirmed_users = [] # Verify each user , Know that there is no unverified ...

  2. python The circular structure of the foundation and the list

    python Basic compiler selection , Loop structure , list Content of this section python IDE The choice of Formatted output of string data type Loop structure list Simple shopping cart writing 1.python IDE The choice of IDE It's called integration ...

  3. Chapter five :python The circular structure of the foundation and the list

    python The circular structure of the foundation and the list   python Basic compiler selection , Loop structure , list Content of this section python IDE The choice of Formatted output of string data type Loop structure list Simple shopping cart writing 1.pyth ...

  4. Lonely lotus Ling Han taught himself python Sixth days The nesting of list and the main method of list

    Lonely lotus Ling Han taught himself python Sixth days The nesting of list and the main method of list ( The complete learning process screen records the video address at the end of the article , Handwritten notes at the end of the text ) ( Synchronous voice note reading :https://www.ximalaya.com/keji/1 ...

  5. Python List remove Method considerations

    Why not delete all the elements in the list ? explain : In order of execution , After the first space is removed , The elements behind will move forward ( become [' Space ',' Space ','12','23']), Next time the pointer points to the second element of the new list ( The third void in the initial state ...

  6. Python Various methods of listing in

    The list is Python It's a common way to store information in , So you should master all kinds of methods of listing : First we define a list (name), Then practice the various methods in it : >>> name = ["Sora ...

  7. for loop , Numbers 、 String and list built-in methods

    Catalog Control flow of for loop Basic grammar for+break for+continue for+else for Loop printing lodaing Number type built-in methods integer int floating-point float String built-in methods ...

  8. python Forbid the function to modify the implementation method of the list

    python Forbid the function to modify the implementation method of the list occasionally , You need to prevent the function from modifying the list . For example, to modify fission , Also keep the original unprinted design list , For the record . To solve this problem , You can pass a copy of the list to a function instead of the original : So what this function does ...

  9. Python Language learning : List common methods

    python List common methods 1.append( ): Used to add new objects at the end of the list list.appent(obj) #obj: Objects added to the end of the list #!/usr/bin/python aList = ...

Random recommendation

  1. [Jenkins] Jenkins Configure the meaning of automatic build time

  2. [UEditor] Baidu editor configuration summary

    Front end configuration file ueditor.config.js The front end has two important configuration properties : UEDITOR_HOME_URL: Configure the resource directory path of Baidu editor , You can specify this path manually , The default is URL Variable assignment , and URL Variable ...

  3. PostMan Getting started

    Recently, we need to test REST API, I found... By accident PostMan This chrome plug-in unit , I played with it , Find out postman It has always been google Powerful tools , Easy to use qualities . It is much joyful to share the joy than enjoy alone. , I'd like to share it with you ...

  4. 1.1、Mybatis First level cache test

    package me.gacl.test; import me.gacl.domain.User; import me.gacl.util.MyBatisUtil; import org.apache ...

  5. 《Android Exploration of development Art 》 Reading notes (13) The first 13 Chapter Integrated technology 、 The first 14 Chapter JNI and NDK Programming 、 The first 15 Chapter Android performance optimization

    The first 13 Chapter Integrated technology 13.1 Use CrashHandler To get the Crash Information (1) Applications happen Crash Be unavoidable , But how to collect crash What about information for subsequent development ? utilize Thread Class set ...

  6. Chapter one :GCD The concept of multithreading

    1. What do you mean GCD? In a nutshell :Grand Central Dispatch For short , Chinese translation is :” The central scheduler of Niubi “ This is pure C Language , There are also many powerful functions 2.GCD The comparative advantage of : (1)GCD yes ...

  7. jxl Reading and writing excel, poi Reading and writing excel,word, Read Excel Data to MySQL

    This article blog It's the introduction : 1. java Medium poi Technology reading Excel data , Then save to MySQL In the data . 2. jxl Reading and writing excel You can also be in : java Of poi Technology read and import Excel Learn to write Exc ...

  8. ES6 Array extension

    In front of the word Arrays are a basic JS object , Over time ,JS The rest of the world has been evolving , And until ES5 The standard introduces some new methods to simplify the use of array objects .ES6 Standards continue to improve arrays , A lot of new features have been added . This article will introduce in detail ES6 Array expansion ...

  9. nvm Version control and node.js

    nvm node.js Version control tools download nvm package Address :https://github.com/coreybutler/nvm-windows/releases Let's pick the first one :nvm-noinst ...

  10. 12、Filter( Interceptor )

    One . filter (Filter): Also known as interceptor . Realization Filter The class of the interface we call Filter( Filters or interceptors ),Filter It can intercept the resources accessed by users . for example : The request sent by the client is , Stop the request first , Judge whether the user is ...