what is null in python?

0 votes
what is a null object in python?

what is the significance, how do i use it in a program?
Mar 8 in Python by Mohammad
• 1,400 points
17 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

as None is an object, you can test for it just like any other object.\

you can use it in a program like:

if (condition) is null :

answered Mar 8 by Waseem
• 2,070 points
0 votes

In python no primitive data types. python treats as object and the theres reference so there is on any explicit variable declaration like Java or c (String var_name=”Hello”; in java )it happens implicitly once you assign the object to reference then it looks appear like variable which of that object type so if you create reference and assign None(usually in other languages Null) it means your not referring any thing but when you create a empty string (by using ‘’ ) . in that case there is reference and string also there but the thing is that string length is zero which means that string nothing have to execute consider my follow code

type( string_var1)

<class 'NoneType'>

>>> print( string_var1)

None

>>> string_var2=''

>>> type( string_var2)

<class 'str'>

>>> len( string_var2)

0

answered Mar 13 by rajesh kumar
But aren't strings, integer, float etc., primitive datatypes in python?
Hello Sir. Can you please tell how your answer is relevant to this question?

Related Questions In Python

+2 votes
3 answers

what is the practical use of polymorphism in Python?

Polymorphism is the ability to present the ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,420 points
968 views
+4 votes
7 answers
0 votes
2 answers

What do you mean by python scripting? What is a script and a module in python?

A scripting language is a programming language ...READ MORE

answered Mar 14 in Python by rajesh kumar
1,716 views
0 votes
1 answer

What is the use of raw_input function in Python?

raw_input fuction is no longer available in ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
38 views
0 votes
1 answer

What is the flow control for “continue” in python?

This is the way "continue" statement works! You ...READ MORE

answered Jul 16, 2018 in Python by Priyaj
• 56,120 points
31 views
+1 vote
1 answer

What is the correct order to learn concepts in Python for machine learning?

Machine Learning is a vast domain. It ...READ MORE

answered Jul 25, 2018 in Python by ANMOL
• 3,620 points
31 views
+1 vote
1 answer

How to check if a string is null in python

Try this: if cookie and not cookie.isspace(): # the ...READ MORE

answered Aug 20, 2018 in Python by Priyaj
• 56,120 points
778 views
+1 vote
1 answer

What is the function for Factorial in Python

Easiest way: math.factorial(x) (available in 2.6 and ...READ MORE

answered Aug 21, 2018 in Python by Priyaj
• 56,120 points

edited Aug 21, 2018 by Omkar 57 views
0 votes
1 answer

what is a type error in python?

you get a type error when you ...READ MORE

answered Mar 8 in Python by Waseem
• 2,070 points
29 views
0 votes
1 answer

what is an else if statement in python?

if condition:    statement elif condition:     statement #this is how you use ...READ MORE

answered Mar 15 in Python by Waseem
• 2,070 points
15 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.