Python Tests / Quizes (original) (raw)
Python hosting: Host, run, and code Python in the cloud!
If you finished the Python beginner series, you could do this quiz to test your understanding of Python. Don’t worry, more tutorials are being created on a weekly and sometimes daily basis.
We hope you like our tutorials and enjoy the quizes!
Related Course: Python Programming Bootcamp: Go from zero to hero
Python Beginner Quiz
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
A quiz to understand your understanding of Python. This quiz only covers parts of the beginners series and not all of the topics covered on this site including variables, functions, classes, objects and many more. We recommend you do the beginner series first if you have not done so yet.
The quiz consists of 20 questions.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
0 of 20 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
- Not categorized 0%
- Thanks for taking our quiz. We hope you enjoyed it, please check out our other tutorials on this site.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Answered
Review
Question 1 of 20
1 points
Which function displays a message on the screen in Python?- sys.out.println()
- print()
- writeln()
- console.writeln()
Question 2 of 20
1 points
How do we get a variable from the command line?- cin << "Enter message";
- input("Enter message")
- console.read("Enter message")
- system.readline("Enter message")
Question 3 of 20
1 points
Which of these prints the length of a string s?- print len(s)
- print s.length()
- print s.len()
- print string.length(s)
Question 4 of 20
1 points
If we have a list x [1,2,3,4], how do we print the first element?- print x[0]
- print x[1]
- print x.first()
- print x(0)
Question 5 of 20
1 points
How do we remove an element from a list?- list.delete()
- list.delete(-1)
- list.remove()
- list.remove(-1)
Question 6 of 20
1 points
Which operator is used to compare two numbers for equality?- =
- ==
- !=
- +=
Question 7 of 20
1 points
How can we define a function in Python?- int add(int a, int b):
- method add(int a, int b):
- def add(a,b):
Question 8 of 20
1 points
Which is the correct output for :
for i in range(1,10):
print(i)- 1,2,3,4,5,6,7,8,9
- 1,2,3,4,5,6,7,8,9,10
- 0,1,2,3,4,5,6,7,8,9,10
- 1,2,3,4,5,6,7,8
Question 9 of 20
1 points
What is the binary number 00001010 in decimal?- 4
- 16
- 32
- 10
Question 10 of 20
1 points
Should you use recursion for factorial?
- Yes
- No
- Question 11 of 20
1 points
Check the correct box
- An object can be created without a class
- An object is an instance of an interface
- An object is an instance of a class
- None of the above
- Question 12 of 20
1 points
What is inheritance used for?
- To give a class the methods and variables of an interface
- To create a new object
- To give an interface the methods and variables of a class
- To give a class the variables but not the methods
- Question 13 of 20
1 points
True or false, a dictionary is always in order.
- True
- False
- Question 14 of 20
1 points
If User is a class, how do we make a new User object?
- x = User()
- x = new User()
- User x = new User()
- User.new(Object)
- Question 15 of 20
1 points
An object can contain:
- Only variables
- Only methods
- Variables and methods
- None of the above
- Question 16 of 20
1 points
When would you use a while loop?
- If the number of iterations is certain
- If the number of iterations is uncertain
- Question 17 of 20
1 points
What is a nested loop?
- A loop without conditions
- A loop with an if statement
- A loop within a loop
- None of the above
- Question 18 of 20
1 points
How can you include a module in Python?
- include module
- import module
- require module
- load module
- Question 19 of 20
1 points
How to find your Python version?
- python -version
- python --version
- python --show version
- python version
- Question 20 of 20
1 points
True or false, a function can be defined inside a function
- True
- False
Python Beginner Quiz 2
0 of 10 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Information
Another Python quiz to test your knowledge of Python for the beginners series. The quiz includes some general questions on the Python programming langage.
You may be surprised to find some of the answers.
The test Consists of 10 questions.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
0 of 10 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Categories
Not categorized 0%
1
2
3
4
5
6
7
8
9
10
Answered
Review
Question 1 of 10
Who originally created Python?- Bram Moolenaar
- Guido van Rossum
- David Lee
- Bill Joy
Question 2 of 10
Which of these is not a Python datatype?- int
- long
- decimal
- float
Question 3 of 10
How can we add two strings together?- s.join(s2)
- s.add(s2)
- s = s + s2
- s ++ s2
Question 4 of 10
How can we create a newline in a print function?- \\
- \"
- \t
- \n
Question 5 of 10
Which is not a valid Python loop?- for loop
- while loop
- iter loop
Question 6 of 10
What is a nested loop?- a loop without condition
- a loop called from an object
- a loop inside a loop
- a recursive loop
Question 7 of 10
How to access list elements?- print l->get(0)
- print l.item(0)
- print l(0)
- print l[0]
Question 8 of 10
When was Python first created?- 1991
- 1995
- 2000
- 2005
Question 9 of 10
Does python support object oriented programming?- No
- Yes
Question 10 of 10
Does Python have support for random numbers?
- No
- Yes, using random library.