Python Quiz 3

by Apr 26, 2020Python Quiz

Welcome to your Python Quiz 3

Email ID
Name
1. 

How can you express the hexadecimal value b2 as a base 16-integer constant in Python?

2. 

Which of the following is not a Python built-in function?

3. 

Identify the right way to write "Welcome to Python" in a file?

4. 

Which method returns a string that includes everything specified in the path?

5. 

str="Hello world"
str[6]='W'
print(str)

Find the type of error?

6. 

import re
List=["Log Lot", "Leg Lead", "Lo Lo", "Kin Pin"]
for i in List:
match=re.match("(L\w+)\W(L\w+)",i)
if match:
print(match.group(), end=' ')

What will be the output?

7. 

Which one is the format operator?

8. 

Which regular expression is not equivalent to the others?

9. 

def f():
global var
print(varr)
var=10
print(var)
var=100
f()

Find the type of error?

10. 

__________ loop is called a definite loop.

11. 

Find the output

import math as m
print(math.sqrt(25))

12. 

Find the output
'Hello'.join(['Welcome', 'to', 'the', 'world', 'of', 'Python'])

13. 

"%s %s %s %s" % ('Welcome', 'to', 'Python')
Identify the type of error

14. 

import re
>>> print(re.sub(r"([a-zA-Z]+)(\d+)", r"\2 of \1", "Jan 16, June 04, September 20, Dec 09"))

Find the output

15. 

In the seek() method, what will be the value of from if you want to specify number of bytes from the current location of the file pointer?

16. 

A file is stored in __________ memory

17. 

The default access mode is __________

18. 

tup1=(3,4,5,6)
tup2=(1,2,6,8)
print(tup1-tup2)

Find the error:

19. 

if Dict={1:2, 3:4, 4:11, 5:6, 7:8} then 
print(Dict[Dict[3]])
will print

20. 

Which function constructs a list from those elements of the list for which function returns true?

Creating a multiplication Skill in Alexa using python

Written By Monisha Macharla

Hi, I'm Monisha. I am a tech blogger and a hobbyist. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. Thank you for reading my blog! Happy learning!

RELATED POSTS

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....