PYnative

Python Programming

  • Learn Python
  • Exercises
  • Quizzes
  • Code Editor
  • Tricks
Home » Python » Quizzes » Python Variables and Data Types Quiz

Python Variables and Data Types Quiz

Updated on: March 9, 2021 | Python Tags: Basics Python Quizzes

TweetF  sharein  shareP  Pin

This Python Variables and Data Types Quiz provide Multiple Choice Questions(MCQ) to get familiar with different data types of variables. This online quiz will help you to improve the understanding of Python variable assignment and casting.

Learn Variables in Python and Python Data Types before solving this quiz.

Also, Solve Python Basic Exercise for Beginners

  • The quiz contains 13 Questions. Solve 8 correct to pass the test.
  • You will have to read all the given answers and click over the correct answer.

1. What is the result of print(type({}) is set)

 
 

2. What is the data type of the following

aTuple = (1, 'Jhon', 1+3j)
print(type(aTuple[2:3]))
 
 
 

3. What is the output of the following code

print(bool(0), bool(3.14159), bool(-3), bool(1.0+1j))

 
 
 
 

4. What is the data type of print(type(10))

 
 
 

5. Select the right way to create a string literal Ault'Kelly

 
 
 

6. What is the output of the following code

x = 50
def fun1():
    x = 25
    print(x)
fun1()
print(x)
 
 
 

7. What is the output of the following variable assignment

x = 75
def myfunc():
    x = x + 1
    print(x)

myfunc()
print(x)
 
 
 
 

8. In Python 3, what is the type of type(range(5))

 
 
 

9. What is the result of print(type([]) is list)

 
 

10. What is the output of the following code

def func1():
    x = 50
    return x
func1()
print(x)
 
 
 

11. What is the data type of print(type(0xFF))

 
 
 
 

12. Please select the correct expression to reassign a global variable “x” to 20 inside a function fun1()

x = 50
def fun1():
    # your code to assign global x = 20
fun1()
print(x) # it should print 20
 
 
 
 

13. Select all the valid String creation in Python

 
 
 

Loading ... Loading …

Loading

Did you find this page helpful? Let others know about it. Sharing helps me continue to create free Python resources.

TweetF  sharein  shareP  Pin

About Vishal

Founder of PYnative.com I am a Python developer and I love to write articles to help developers. Follow me on Twitter. All the best for your future Python endeavors!

Related Tutorial Topics:

Basics Python Quizzes

Python Exercises and Quizzes

Free coding exercises and quizzes cover Python basics, data structure, data analytics, and more.

  • 15+ Topic-specific Exercises and Quizzes
  • Each Exercise contains 10 questions
  • Each Quiz contains 12-15 MCQ
Exercises
Quizzes

Leave a Reply Cancel reply

your email address will NOT be published. all comments are moderated according to our comment policy.

Use <pre> tag for posting code. E.g. <pre> Your code </pre>

19 Comments

  Python Quizzes

  • Python Quizzes Home
  • Basic Quiz For Beginners
  • Variables and Data Types Quiz
  • Operators and Expression Quiz
  • Input and Output Quiz
  • Functions Quiz
  • If Else and Loops Quiz
  • Numbers Quiz
  • String Quiz
  • List Quiz
  • Set Quiz
  • Dictionary Quiz
  • Tuple Quiz
  • Random Data Generation Quiz

All Python Topics

Python Basics Python Exercises Python Quizzes Python Regex Python Random Python Pandas Python Databases Python MySQL Python PostgreSQL Python SQLite Python JSON
TweetF  sharein  shareP  Pin

About PYnative

PYnative.com is for Python lovers. Here, You can get Tutorials, Exercises, and Quizzes to practice and improve your Python skills.

Explore Python

  • Learn Python
  • Python Basics
  • Python Databases
  • Python Exercises
  • Python Quizzes
  • Online Python Code Editor
  • Python Tricks

Follow Us

To get New Python Tutorials, Exercises, and Quizzes

  • Twitter
  • Facebook
  • Sitemap

Legal Stuff

  • About Us
  • Privacy Policy
  • Cookie Policy
  • Terms Of Use
  • Contact Us
DMCA.com Protection Status

Copyright © 2018-2021 · [pynative.com]

This website uses cookies to ensure you get the best experience on our website.Privacy PolicyGot it!