• Barajar
    Activar
    Desactivar
  • Alphabetizar
    Activar
    Desactivar
  • Frente Primero
    Activar
    Desactivar
  • Ambos lados
    Activar
    Desactivar
  • Leer
    Activar
    Desactivar
Leyendo...
Frente

Cómo estudiar sus tarjetas

Teclas de Derecha/Izquierda: Navegar entre tarjetas.tecla derechatecla izquierda

Teclas Arriba/Abajo: Colvea la carta entre frente y dorso.tecla abajotecla arriba

Tecla H: Muestra pista (3er lado).tecla h

Tecla N: Lea el texto en voz.tecla n

image

Boton play

image

Boton play

image

Progreso

1/19

Click para voltear

19 Cartas en este set

  • Frente
  • Atrás
What does the ‘#’ symbol do in Python?
‘#’ is used to comment on everything that comes after on the line.
What is the difference between a Mutable datatype and an Immutable data type?
Mutable data types can be edited i.e., they can change at runtime. Eg – List, Dictionary, etc.
Immutable data types can not be edited i.e., they can not change at runtime. Eg – String, Tuple, etc.
What is the difference between a Set and Dictionary?
The set is an unordered collection of data types that is iterable, mutable and has no duplicate elements.
A dictionary in Python is an ordered collection of data values, used to store data values like a map.
What is List Comprehension?
List comprehension is a syntax construction to ease the creation of a list based on existing iterable.
my_list = [i for i in range(1, 10)]
What is a lambda function?
A lambda function is an anonymous function. This function can have any number of parameters but, can have just one statement. For Example:
a = lambda x, y : x*y
print(a(7, 19))
What is a pass in Python?
Pass means performing no operation or in other words, it is a placeholder in the compound statement, where there should be a blank left and nothing has to be written there.
What is the difference between / and // in Python?
/ represents precise division (result is a floating point number) whereas // represents floor division (result is an integer).
5//2 = 2
5/2 = 2.5
What is swapcase function in Python?
It is a string’s function that converts all uppercase characters into lowercase and vice versa. It is used to alter the existing case of the string. This method creates a copy of the string which contains all the characters in the swap case.
What is docstring in Python?
Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, and methods.
What is a break, continue, and pass in Python?
The break statement is used to terminate the loop or statement in which it is present. After that, the control will pass to the statements that are present after the break statement, if available.

Continue is also a loop control statement just like the break statement. continue statement is opposite to that of the break statement, instead of terminating the loop, it forces to execute the next iteration of the loop.

Pass means performing no operation or in other words, it is a placeholder in the compound statement, where there should be a blank left and nothing has to be written there.
What are Built-in data types in Python?
Numeric: A numeric value can be an integer, a floating number, a Boolean, or even a complex number.
Sequence Type:
Python String
Python List
Python Tuple
Python range
Mapping Types: There is currently only one common mapping type, the dictionary, and mapping objects are mutable.
Python Dictionary
Set Types: In Python, a Set is an unordered collection of data types that is iterable, mutable, and has no duplicate elements.
Differentiate between List and Tuple?
List

Lists are Mutable datatype.
Lists consume more memory
The list is better for performing operations, such as insertion and deletion.
The implication of iterations is Time-consuming
Tuple

Tuples are Immutable datatype.
Tuple consumes less memory as compared to the list
A Tuple data type is appropriate for accessing the elements
The implication of iterations is comparatively Faster
What are Iterators in Python?
In Python, iterators are used to iterate a group of elements, containers like a list. Iterators are collections of items, and they can be a list, tuples, or a dictionary.
What are Decorators?
It is a function to alter functions easily.
What are Iterators in Python?
In Python, iterators are used to iterate a group of elements, containers like a list.
What is slicing in Python?
is a string operation for extracting a part of the string, or some part of a list.
What is __init__?
is a contructor method in Python and is automatically called to allocate memory when a new object/instance is created.
What is the difference between Python Arrays and lists?
Arrays in python can only contain elements of same data types i.e., data type of array should be homogeneous. It is a thin wrapper around C language arrays and consumes far less memory than lists.
Lists in python can contain elements of different data types i.e., data type of lists can be heterogeneous. It has the disadvantage of consuming large memory.
What is the use of self in Python?
Self is used to represent the instance of the class.