Welcome to collectivesolver - Programming & Software Q&A. A website you can trust. All programs tested and works. Contact: aviboots(AT)netvision.net.il
BlueHost Web Hosting

Bonsai Boy of New York Bonsai Trees and Accessories

Website Domains Names & Hosting | Domain.com

Ecommerce Software - Best Ecommerce Platform Made for You - Free Trial

DreamHost Web Hosting


getResponse autofunnels

Liquid Web Cloud VPS Hosting

Disclosure We are a professional Information website that receives compensation from some of the links whose we show you with Information. It means that my content may contain affiliate links.

12,195 questions

16,607 answers

573 users

How to check the data type of a variable in Python

7 Answers

0 votes
n = 100

print(type(n))


'''
run:

<class 'int'>

'''

 




answered Sep 19, 2017 by avibootz
0 votes
n = 9986476356245100599

print(type(n))


'''
run:

<class 'int'>

'''

 




answered Sep 19, 2017 by avibootz
0 votes
pi = 3.14

print(type(pi))


'''
run:

<class 'float'>

'''

 




answered Sep 19, 2017 by avibootz
0 votes
ch = 'Z'

print(type(ch))


'''
run:

<class 'str'>

'''

 




answered Sep 19, 2017 by avibootz
0 votes
s = 'Python'

print(type(s))


'''
run:

<class 'str'>

'''

 




answered Sep 19, 2017 by avibootz
0 votes
b = True

print(type(b))


'''
run:

<class 'bool'>

'''

 




answered Sep 19, 2017 by avibootz
0 votes
v = None

print(type(v))


'''
run:

<class 'NoneType'>

'''

 




answered Sep 19, 2017 by avibootz
...