In Python programming concatenate two strings is very easy. Strings can be concatenated with the + operator, and repeated with * operator. Examples are given
Category: Python Interview Questions
Important Python interview questions
What is generator in python?
Generator in python is a function which returns an iterator. It looks like a normal function except that it contains yield statements
What is triple-quoted string in python?
Triple quoted string in python is a string which is bound by three instances of either a quotation mark (”)
What is universal newlines in python?
Universal newlines in python is a manner of interpreting text streams in which all of the following are recognized as
What __slots__ does?
–slot– is a declaration inside a class that saves memory by pre-declaring space for instance attributes and eliminating instance dictionaries.
What is ested scope in python?
ested scope in python is the ability to refer to a variable in an enclosing definition. For instance, a function
What is namespace?
Namespace is the place where a variable is stored. Namespaces are implemented as dictionaries. There are the local, global and
What is mutable and immutable in python?
Mutable objects can change their value but keep their id(). Immutable is an object with a fixed value. Immutable objects include
What is named tuple in python?
Any tuple-like class whose indexable elements are also accessible using named attributes (for example, time.localtime() returns a tuple-like object where the year is accessible
What is metaclass in python?
Metaclass is the class of a class. Class definitions create a class name, a class dictionary, and a list of
What is list comprehension in Python?
List comprehension is a compact way to process all or part of the elements in a sequence and return a
What is lambda in Python?
lambda is an anonymous inline function consisting of a single expression which is evaluated when the function is called. The syntax to
What is Python 3000?
Python 3000 is nickname for the Python 3.x release line (coined long ago when the release of version 3 was
What this command tells to operating system ” #! /usr/bin/env python3 “ ?
This is not technically a part of the program. It is there to tell the operating system what version of