Skip to content

learndataa

Imagine data to solve problems

  • Home
  • YouTube Courses
  • Udemy Courses
  • Training
  • About
  • Privacy Policy
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
  • Home
  • YouTube Courses
  • Udemy Courses
  • Training
  • About
  • Privacy Policy
  • Facebook
  • Twitter
  • Instagram
  • Pinterest

Create an empty list

20 August 2020

Code

# Create empty list
x = []
y = list()

# Output
print(x)
print(type(x), '; Is empty:',not x, '; len(x):', len(x), '\n')
print(y)
print(type(y), '; Is empty:',not y, '; len(y):', len(y))
[]
<class 'list'> ; Is empty: True ; len(x): 0 

[]
<class 'list'> ; Is empty: True ; len(y): 0






Any errors in code above?
Please send a message.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook
  • Home
  • YouTube Courses
  • Udemy Courses
  • Training
  • About
  • Privacy Policy
  • Facebook
  • Twitter
  • Instagram
  • Pinterest
learndataa, Website Powered by WordPress.com.
  • Subscribe Subscribed
    • learndataa
    • Already have a WordPress.com account? Log in now.
    • learndataa
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • View post in Reader
    • Manage subscriptions
    • Collapse this bar