My Report

Python Programming Mock Test 8


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. What is the default base used when math.log(x) is found?

Question 1 of 10

Question 2 of 10

2. What will be the output of the following Python code?

import turtle
t=turtle.Pen()
t.color(0,1,0)
t.begin_fill()
for i in range(0,4):
	t.forward(100)
	t.right(90)

Question 2 of 10

Question 3 of 10

3. What does os.name contain?

Question 3 of 10

Question 4 of 10

4. What will be the output of the following Python function (random module has already been imported)?

random.choice('sun')

Question 4 of 10

Question 5 of 10

5. Which type of elements are accepted by random.shuffle()?

Question 5 of 10

Question 6 of 10

6. What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?

import turtle
t=turtle.Pen()
t.goto(100,0)
t.towards(0,0)

Question 6 of 10

Question 7 of 10

7. What will be the output of the following Python code?

import turtle()
t=turtle.Pen()
t.goto(50,60)
t1=t.clone()
t1.ycor()

Question 7 of 10

Question 8 of 10

8. What will be the output of the following Python code?

import turtle
t=turtle.Pen()
t.backward(100)
t.penup()
t.right(45)
t.isdown()

Question 8 of 10

Question 9 of 10

9. The command which helps us to reset the pen (turtle):

Question 9 of 10

Question 10 of 10

10. What will be the output of the following Python code?

import turtle
t=turtle.Pen()
t.goto(300,9)
t.position()

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.