Wednesday 24 January 2024

Data Integration with Microsoft Azure Data Factory

 


What you'll learn

How to create and manage data pipelines in the cloud 

How to integrate data at scale with Azure Synapse Pipeline and Azure Data Factory

Join Free: Data Integration with Microsoft Azure Data Factory

There are 8 modules in this course

In this course, you will learn how to create and manage data pipelines in the cloud using Azure Data Factory.

This course is part of a Specialization intended for Data engineers and developers who want to demonstrate their expertise in designing and implementing data solutions that use Microsoft Azure data services. It is ideal for anyone interested in preparing for the DP-203: Data Engineering on Microsoft Azure exam (beta). 

This is the third course in a program of 10 courses to help prepare you to take the exam so that you can have expertise in designing and implementing data solutions that use Microsoft Azure data services. The Data Engineering on Microsoft Azure exam is an opportunity to prove knowledge expertise in integrating, transforming, and consolidating data from various structured and unstructured data systems into structures that are suitable for building analytics solutions that use Microsoft Azure data services. Each course teaches you the concepts and skills that are measured by the exam. 

By the end of this Specialization, you will be ready to take and sign-up for the Exam DP-203: Data Engineering on Microsoft Azure (beta).

Data Storage in Microsoft Azure

 


What you'll learn

You will learn the basics of storage management in Azure, how to create a Storage Account, and how to choose the right model for your data.

Design and implement data storage and data security

Design and develop data processing

Monitor and optimize data storage and data processing

Join Free: Data Storage in Microsoft Azure

There are 5 modules in this course

Azure provides a variety of ways to store data: unstructured, archival, relational, and more. In this course, you will learn the basics of storage management in Azure, how to create a Storage Account, and how to choose the right model for the data you want to store in the cloud.

This course part of a Specialization intended for Data engineers and developers who want to demonstrate their expertise in designing and implementing data solutions that use Microsoft Azure data services anyone interested in preparing for the Exam DP-203: Data Engineering on Microsoft Azure (beta). 

This is the second in a program of 10 courses to help prepare you to take the exam so that you can have expertise in designing and implementing data solutions that use Microsoft Azure data services. The Data Engineering on Microsoft Azure exam is an opportunity to prove knowledge expertise in integrating, transforming, and consolidating data from various structured and unstructured data systems into structures that are suitable for building analytics solutions that use Microsoft Azure data services. Each course teaches you the concepts and skills that are measured by the exam. 

By the end of this Specialization, you will be ready to take and sign-up for the Exam DP-203: Data Engineering on Microsoft Azure (beta).

Microsoft Azure Data Engineering Associate (DP-203) Professional Certificate

 


Advance your career with in-demand skills

Receive professional-level training from Microsoft

Demonstrate your technical proficiency

Earn an employer-recognized certificate from Microsoft

Prepare for an industry certification exam

Join Free: Microsoft Azure Data Engineering Associate (DP-203) Professional Certificate

Professional Certificate - 10 course series

This Professional Certificate is intended for data engineers and developers who want to demonstrate their expertise in designing and implementing data solutions that use Microsoft Azure data services anyone interested in preparing for the Exam DP-203: Data Engineering on Microsoft Azure. 

This Professional Certificate will help you develop expertise in designing and implementing data solutions that use Microsoft Azure data services. You will learn how to integrate, transform, and consolidate data from various structured and unstructured data systems into structures that are suitable for building analytics solutions that use Microsoft Azure data services. 

This program consists of 10 courses to help prepare you to take Exam DP-203: Data Engineering on Microsoft Azure. Each course teaches you the concepts and skills that are measured by the exam. 

By the end of this Professional Certificate, you will be ready to take and sign-up for the Exam DP-203: Data Engineering on Microsoft Azure.

Applied Learning Project

Learners will engage in interactive exercises throughout this program that offers opportunities to practice and implement what they are learning. They use the Microsoft Learn Sandbox. This is a free environment that allows learners to explore Microsoft Azure and get hands-on with live Microsoft Azure resources and services.


For example, when you learn about integrating, transforming, and consolidating data; you will work in a temporary Azure environment called the Sandbox or directly in the Azure Portal. The beauty about this is that you will be working with real technology but in a controlled environment, which allows you to apply what you learn, and at your own pace.


You will need a Microsoft account. If you don't have one, you can create one for free. The Learn Sandbox allows free, fixed-time access to a cloud subscription with no credit card required. Learners can safely explore, create, and manage resources without the fear of incurring costs or "breaking production".

Data Engineering with MS Azure Synapse Apache Spark Pools

 


What you'll learn

How to perform data engineering with Azure Synapse Apache Spark Pools to boost the performance of big-data analytic applications

How to ingest data using Apache Spark Notebooks in Azure Synapse Analytics

How to transform data using DataFrames in Apache Spark Pools in Azure Synapse Analytics

How to monitor and manage data engineering workloads with Apache Spark in Azure Synapse Analytics

Join Free: Data Engineering with MS Azure Synapse Apache Spark Pools

There are 3 modules in this course

In this course, you will learn how to perform data engineering with Azure Synapse Apache Spark Pools, which enable you to boost the performance of big-data analytic applications by in-memory cluster computing.

You will learn how to differentiate between Apache Spark, Azure Databricks, HDInsight, and SQL Pools and understand the use-cases of data-engineering with Apache Spark in Azure Synapse Analytics. You will also learn how to ingest data using Apache Spark Notebooks in Azure Synapse Analytics and transform data using DataFrames in Apache Spark Pools in Azure Synapse Analytics. You will integrate SQL and Apache Spark pools in Azure Synapse Analytics. You will also learn how to monitor and manage data engineering workloads with Apache Spark in Azure Synapse Analytics.

This course is part of a Specialization intended for Data engineers and developers who want to demonstrate their expertise in designing and implementing data solutions that use Microsoft Azure data services for anyone interested in preparing for the Exam DP-203: Data Engineering on Microsoft Azure (beta). You will take a practice exam that covers key skills measured by the certification exam.

This is the sixth course in a program of 10 courses to help prepare you to take the exam so that you can have expertise in designing and implementing data solutions that use Microsoft Azure data services. The Data Engineering on Microsoft Azure exam is an opportunity to prove knowledge expertise in integrating, transforming, and consolidating data from various structured and unstructured data systems into structures that are suitable for building analytics solutions that use Microsoft Azure data services. Each course teaches you the concepts and skills that are measured by the exam. 

By the end of this Specialization, you will be ready to take and sign-up for the Exam DP-203: Data Engineering on Microsoft Azure (beta).

Create Machine Learning Models in Microsoft Azure

 


What you'll learn

How to plan and create a working environment for data science workloads on Azure 

How to run data experiments and train predictive models

Join Free: Create Machine Learning Models in Microsoft Azure

There are 3 modules in this course

Machine learning is the foundation for predictive modeling and artificial intelligence. If you want to learn about both the underlying concepts and how to get into building models with the most common machine learning tools this path is for you. In this course, you will learn the core principles of machine learning and how to use common tools and frameworks to train, evaluate, and use machine learning models.

This course is designed to prepare you for roles that include planning and creating a suitable working environment for data science workloads on Azure. You will learn how to run data experiments and train predictive models. In addition, you will manage, optimize, and deploy machine learning models into production.

From the most basic classical machine learning models, to exploratory data analysis and customizing architectures, you’ll be guided by easy -to-digest conceptual content and interactive Jupyter notebooks.

If you already have some idea what machine learning is about or you have a strong mathematical background this course is perfect for you. These modules teach some machine learning concepts, but move fast so they can get to the power of using tools like scikit-learn, TensorFlow, and PyTorch. This learning path is also the best one for you if you're looking for just enough familiarity to understand machine learning examples for products like Azure ML or Azure Databricks. It's also a good place to start if you plan to move beyond classic machine learning and get an education in deep learning and neural networks, which we only introduce here.

This program consists of 5 courses to help prepare you to take the Exam DP-100: Designing and Implementing a Data Science Solution on Azure. The certification exam is an opportunity to prove knowledge and expertise operate machine learning solutions at cloud scale using Azure Machine Learning. This specialization teaches you to leverage your existing knowledge of Python and machine learning to manage data ingestion and preparation, model training and deployment, and machine learning solution monitoring in Microsoft Azure . Each course teaches you the concepts and skills that are measured by the exam.

Tuesday 23 January 2024

Python Coding challenge - Day 118 | What is the output of the following Python Code?

 


Code:

def test(i, j):

    if i == 0:

        return j

    else:

        return test(i - 1, i + j)


print(test(2, 5))

Solution and Explanation : 

Here's what happens when you call test(2, 5):

i is initially 2, and since it's not 0, the else branch is executed.
It calls test(i - 1, i + j), where i - 1 is 1 and i + j is 7 (2 + 5).
In the new call, i is now 1, and again, the else branch is executed. It calls test(i - 1, i + j) again.
In the next call, i becomes 0. Now, the condition if i == 0 is true, and it returns j which is 1 + 7 = 8.
So, the final result of test(2, 5) is 8

The function essentially calculates the sum of consecutive numbers starting from j and going down to 1, based on the value of i.




Random Models, Nested and Split-plot Designs

 


What you'll learn

Design and analyze experiments where some of the factors are random

Design and analyze experiments where there are nested factors or hard-to-change factors

Analyze experiments with covariates

Design and analyze experiments with nonnormal response distributions

Join Free: Random Models, Nested and Split-plot Designs

There are 3 modules in this course

Many experiments involve factors whose levels are chosen at random. A well-know situation is the study of measurement systems to determine their capability.  This course presents the design and analysis of these types of experiments, including modern methods for estimating the components of variability in these systems. The course also covers experiments with nested factors, and experiments with hard-to-change factors that require split-plot designs. We also provide an overview of designs for experiments with response distributions from nonnormal response distributions and experiments with covariates.

Response Surfaces, Mixtures, and Model Building

 


What you'll learn

Conduct experiments w/computer models and understand how least squares regression is used to build an empirical model from experimental design data

Understand the response surface methodology strategy to conduct experiments where system optimization is the objective

Recognize how the response surface approach can be used for experiments where the factors are the components of a mixture

Recognize where the objective of the experiment is to minimize the variability transmitted into the response from uncontrollable factors

Join Free: Response Surfaces, Mixtures, and Model Building

There are 4 modules in this course

Factorial experiments are often used in factor screening.; that is, identify the subset of factors in a process or system that are of primary important to the response. Once the set of important factors are identified interest then usually turns to optimization; that is, what levels of the important factors produce the best values of the response.  This course provides design and optimization tools to answer that questions using the response surface framework.  Other related topics include design and analysis of computer experiments, experiments with mixtures, and experimental strategies to reduce the effect of uncontrollable factors on unwanted variability in the response.

Factorial and Fractional Factorial Designs

 


What you'll learn

Conduct a factorial experiment in blocks and construct and analyze a fractional factorial design

Apply the factorial concept to experiments with several factors

Use the analysis of variance for factorial designs

Use the 2^k system of factorial designs

Join Free: Factorial and Fractional Factorial Designs

There are 4 modules in this course

Many experiments in engineering, science and business involve several factors.  This course is an introduction to these types of multifactor experiments.  The appropriate experimental strategy for these situations is based on the factorial design, a type of experiment where factors are varied together.  This course focuses on designing these types of experiments and on using the ANOVA for analyzing the resulting data.  These types of experiments often include nuisance factors, and  the blocking principle can be used in factorial designs to handle these situations.  As the number of factors of interest grows full factorials become too expensive and fractional versions of the factorial design are useful.  This course will  cover the benefits of fractional factorials, along with methods for constructing and analyzing the data from these experiments.

Experimental Design Basics

 


What you'll learn

By the end of this course, you will be able to:

Approach complex industrial and business research problems and address them through a rigorous, statistically sound experimental strategy

Use modern software to effectively plan experiments

Analyze the resulting data of an experiment, and communicate the results effectively to decision-makers.

Join Free: Experimental Design Basics

There are 5 modules in this course

This is a basic course in designing experiments and analyzing the resulting data. The course objective is to learn how to plan, design and conduct experiments efficiently and effectively, and analyze the resulting data to obtain objective conclusions. Both design and statistical analysis issues are discussed. Opportunities to use the principles taught in the course arise in all aspects of today’s industrial and business environment. Applications from various fields will be illustrated throughout the course.  Computer software packages (JMP, Design-Expert, Minitab) will be used to implement the methods presented and will be illustrated extensively. 

All experiments are designed experiments; some of them are poorly designed, and others are well-designed. Well-designed experiments allow you to obtain reliable, valid results faster, easier, and with fewer resources than with poorly-designed experiments. You will learn how to plan, conduct and analyze experiments efficiently in this course.

Design of Experiments Specialization

 


What you'll learn

Plan, design and conduct experiments efficiently and effectively, and analyze the resulting data to obtain valid objective conclusions.

Use response surface methods for system optimization as a follow-up to successful screening.

Use experimental design tools for computer experiments, both deterministic and stochastic computer models.

Use software tools to create custom designs based on optimal design methodology for situations where standard designs are not easily applicable.

Join Free: Design of Experiments Specialization

Specialization - 4 course series

Learn modern experimental strategy, including factorial and fractional factorial experimental designs, designs for screening many factors, designs for optimization experiments, and designs for complex experiments such as those with hard-to-change factors and unusual responses. There is thorough coverage of modern data analysis techniques for experimental design, including software.  Applications include electronics and semiconductors, automotive and aerospace, chemical and process industries, pharmaceutical and bio-pharm, medical devices, and many others.

You can see an overview of the specialization from Dr. Montgomery here.

Applied Learning Project

Participants will complete a project that is typically based around their own work environment, and can use this to effectively demonstrate the application of experimental design methodology. The structure of the course and the step-by-stem process taught in the course is designed to ensure participant success.

Monday 22 January 2024

Learn to Program: The Fundamentals

 

There are 7 modules in this course

Behind every mouse click and touch-screen tap, there is a computer program that makes things happen. This course introduces the fundamental building blocks of programming and teaches you how to write fun and useful programs using the Python language.

Join free : Learn to Program: The Fundamentals


Skills you'll gain

  • Python Syntax And Semantics
  • Computer Programming
  • Python Programming
  • Idle (Python)

Cheat sheet for Python list



List Basics:

Creating a List:

my_list = [1, 2, 3, 'four', 5.0]

Accessing Elements:

first_element = my_list[0]
last_element = my_list[-1]

Slicing:

sliced_list = my_list[1:4]  # Returns elements at index 1, 2, and 3

List Operations:

Appending and Extending:

my_list.append(6)        # Adds 6 to the end
my_list.extend([7, 8])   # Extends with elements 7 and 8

Inserting at a Specific Position:

my_list.insert(2, 'inserted')  # Inserts 'inserted' at index 2

Removing Elements:

my_list.remove('four')  # Removes the first occurrence of 'four'
popped_element = my_list.pop(2)  # Removes and returns element at index 2

Sorting:

my_list.sort()   # Sorts the list in ascending order
my_list.reverse()  # Reverses the order of elements

List Functions:

Length and Count:

length = len(my_list)          # Returns the number of elements
count_of_element = my_list.count(2)  # Returns the count of occurrences of 2

Index and In:

index_of_element = my_list.index('four')  # Returns the index of 'four'
is_present = 5 in my_list       # Returns True if 5 is in the list, False otherwise

List Comprehensions:

Creating a New List:

squared_numbers = [x**2 for x in range(5)]

Conditional List Comprehension:

even_numbers = [x for x in range(10) if x % 2 == 0]

Miscellaneous:

Copying a List:

copied_list = my_list.copy()

Clearing a List:

my_list.clear()  # Removes all elements from the list

Sunday 21 January 2024

Python Coding challenge - Day 117 | What is the output of the following Python Code?

 


The above code uses the symmetric difference operator (^) between two sets. The symmetric difference of two sets is the set of elements that are in either of the sets, but not in both.

Here's the output of the given code:

set1 = {1, 1, 2}

set2 = {2, 3, 4}

result = set1 ^ set2

print(result)

Output:

{1, 3, 4}

In the result set, you can see that it contains elements 1, 3, and 4, which are present in either set1 or set2 but not in both. Additionally, duplicate elements are automatically removed in a set, so even though set1 contains two occurrences of the element 1, it appears only once in the result set.

Python Quick Interview Guide: Top Expert-Led Coding Interview Question Bank for Python Aspirants

 


Quick solutions to frequently asked algorithm and data structure questions.

Key Features

● Learn how to crack the Data structure and Algorithms Code test using the top 75 questions/solutions discussed in the book.

● Refresher on Python data structures and writing clean, actionable python codes.

● Simplified solutions on translating business problems into executable programs and applications.


Description

Python is the most popular programming language, and hence, there is a huge demand for Python programmers. Even if you have learnt Python or have done projects on AI, you cannot enter the top companies unless you have cleared the Algorithms and data Structure coding test.

This book presents 75 most frequently asked coding questions by top companies of the world. It not only focuses on the solution strategy, but also provides you with the working code. This book will equip you with the skills required for developing and analyzing algorithms for various situations. This book teaches you how to measure Time Complexity, it then provides solutions to questions on the Linked list, Stack, Hash table, and Math. Then you can review questions and solutions based on graph theory and application techniques. Towards the end, you will come across coding questions on advanced topics such as Backtracking, Greedy, Divide and Conquer, and Dynamic Programming.

After reading this book, you will successfully pass the python interview with high confidence and passion for exploring python in future.

What you will learn

● Design an efficient algorithm to solve the problem.

● Learn to use python tricks to make your program competitive.

● Learn to understand and measure time and space complexity.

● Get solutions to questions based on Searching, Sorting, Graphs, DFS, BFS, Backtracking, Dynamic programming.

Who this book is for

This book will help professionals and beginners clear the Data structures and Algorithms coding test. Basic knowledge of Python and Data Structures is a must.

Table of Contents

1. Lists, binary search and strings

2. Linked lists and stacks

3. Hash table and maths

4. Trees and graphs

5. Depth first search

6. Breadth first search

7. Backtracking

8. Greedy and divide and conquer algorithms

9. Dynamic programming

About the Author

Professor Shyamkant Limaye spent 18 years in the computer industry and 30 years in teaching electronics engineering students. His experience includes a two-year stint as a system analyst in the USA. In 1971, he graduated from Visvesvaraya National Institute of Technology in Electrical Engineering with a gold medal. He did masters from IIT Kanpur and Doctorate in electronics from RTM Nagpur University. He has guided ten students for PhD. He published a text book on VHDL programming in 2007. He has also published a thriller novel titled “Dual reality” in 2011. Currently, he is a Professor in the Electronics and Telecomm Department at St. Vincent Pallotti College of Engineering and Technology, Nagpur.

Hard Copy : Python Quick Interview Guide: Top Expert-Led Coding Interview Question Bank for Python Aspirants (English Edition)


Saturday 20 January 2024

Jai Shree Ram using Python Code

from turtle import *
title('Jai Shree Ram')
bgcolor('black')
pensize(5)
pencolor("ORANGE")
Ram_naam = ["जय श्री राम"] * 50
angle = 360 / 50
penup()
sety(-1)
for _ in range(51):
    left(angle)
    forward(260)
    if Ram_naam:
        write(Ram_naam.pop(), align="right", font=('Arial', 12, "bold"))
    backward(260)
penup()    
goto(-40, -20)
pendown()
write("|| जय श्री राम ||", font=("Arial", 50, "normal"), align="center")
hideturtle()
done()
#clcoding.com









Top 20 Python Dictionary Questions with answer

 


Question 1:

What is a dictionary in Python?

a) A collection of ordered elements

b) A collection of unordered elements

c) A single element

d) A data type


Question 2:

How do you create an empty dictionary in Python?

a) empty_dict = {}

b) empty_dict = dict()

c) empty_dict = new dict()

d) Both a and b


Question 3:

How do you access the value associated with a specific key in a dictionary?

a) dictionary.value(key)

b) dictionary[key]

c) dictionary.get(key)

d) dictionary.retrieve(key)


Question 4:

What is the purpose of the len() function when used with a dictionary?

a) It returns the total number of key-value pairs in the dictionary

b) It returns the last key in the dictionary

c) It returns the length of each value in the dictionary

d) It returns the sum of all values in the dictionary


Question 5:

How do you add a new key-value pair to a dictionary?

a) dictionary.add(key, value)

b) dictionary[key] = value

c) dictionary.insert(key, value)

d) dictionary.append(key, value)


Question 6:

What is the key difference between a dictionary and a list in Python?

a) Dictionaries are ordered, while lists are unordered

b) Dictionaries are mutable, while lists are immutable

c) Dictionaries can contain only numeric elements

d) Dictionaries are unordered and do not allow duplicate keys


Question 7:

How do you check if a key is present in a dictionary?

a) key in dictionary

b) dictionary.contains(key)

c) dictionary.exists(key)

d) key.exists(dictionary)


Question 8:

What does the dictionary.keys() method return?

a) The values of the dictionary

b) The keys of the dictionary

c) The key-value pairs of the dictionary

d) The length of the dictionary


Question 9:

How do you remove a key-value pair from a dictionary?

a) dictionary.remove(key)

b) dictionary.discard(key)

c) dictionary.delete(key)

d) All of the above


Question 10:

Which method is used to retrieve the value associated with a key, and if the key is not present, it returns a default value?

a) dictionary.get(key, default)

b) dictionary.retrieve(key, default)

c) dictionary.value(key, default)

d) dictionary.fetch(key, default)


Question 11:

What is the purpose of the pop() method in Python dictionaries?

a) Adds an element to the dictionary

b) Removes the last element from the dictionary and returns its value

c) Removes the first occurrence of the specified element

d) Removes the key-value pair for a specified key


Question 12:

How do you update the value associated with a key in a dictionary?

a) dictionary.update(key, new_value)

b) dictionary[key] = new_value

c) dictionary.modify(key, new_value)

d) dictionary.change_value(key, new_value)


Question 13:

What is the output of the following code?

my_dict = {"a": 1, "b": 2, "c": 3}

del my_dict["b"]

print(my_dict)

a) {"a": 1, "b": 2, "c": 3}

b) {"a": 1, "c": 3}

c) {"a": 1, "b": 2}

d) Raises an error


Question 14:

How do you iterate over the keys of a dictionary?

a) for key in dictionary.keys():

b) for key in dictionary:

c) for key in dictionary.values():

d) for key in dictionary.items():


Question 15:

What is the purpose of the values() method in Python dictionaries?

a) Returns the keys of the dictionary

b) Returns the values of the dictionary

c) Returns the key-value pairs of the dictionary

d) Returns the length of the dictionary


Question 16:

Which method is used to clear all key-value pairs from a dictionary?

a) dictionary.clear()

b) dictionary.remove_all()

c) dictionary.delete()

d) dictionary.empty()


Question 17:

What is the purpose of the items() method in Python dictionaries?

a) Returns the keys of the dictionary

b) Returns the values of the dictionary

c) Returns the key-value pairs of the dictionary

d) Returns the length of the dictionary


Question 18:

What is the output of the following code?

my_dict = {"apple": 3, "banana": 5, "cherry": 2}

sorted_dict = dict(sorted(my_dict.items()))

print(sorted_dict)

a) {"apple": 3, "banana": 5, "cherry": 2}

b) {"cherry": 2, "apple": 3, "banana": 5}

c) {"banana": 5, "apple": 3, "cherry": 2}

d) Raises an error


Question 19:

How do you create a dictionary with keys as numbers from 1 to 5 and values as their squares?

a) squares = {i: i ** 2 for i in range(1, 6)}

b) squares = {i: i * i for i in range(1, 6)}

c) squares = {i: i ** 2 for i in [1, 2, 3, 4, 5]}

d) All of the above


Question 20:

What is the purpose of the copy() method in Python dictionaries?

a) Creates a shallow copy of the dictionary

b) Creates a deep copy of the dictionary

c) Returns the reversed dictionary

d) Appends a copy of the dictionary to itself


Answer Key:

  1. b) A collection of unordered elements
  2. d) Both a and b
  3. b) dictionary[key]
  4. a) It returns the total number of key-value pairs in the dictionary
  5. b) dictionary[key] = value
  6. d) Dictionaries are unordered and do not allow duplicate keys
  7. a) key in dictionary
  8. b) The keys of the dictionary
  9. d) All of the above
  10. a) dictionary.get(key, default)
  11. b) Removes the last element from the dictionary and returns its value
  12. b) dictionary[key] = new_value
  13. b) {"a": 1, "c": 3}
  14. b) for key in dictionary:
  15. b) Returns the values of the dictionary
  16. a) dictionary.clear()
  17. c) Returns the key-value pairs of the dictionary
  18. b) {"cherry": 2, "apple": 3, "banana": 5}
  19. a) squares = {i: i ** 2 for i in range(1, 6)}
  20. a) Creates a shallow copy of the dictionary

Top 20 Python Set Questions with answer



Question 1:

What is a set in Python?

a) A collection of ordered elements

b) A collection of unordered elements

c) A single element

d) A data type


Question 2:

How do you create an empty set in Python?

a) set()

b) empty_set = {}

c) empty_set = set()

d) Both b and c


Question 3:

How do you add an element to a set in Python?

a) set.insert(element)

b) set.add(element)

c) set.append(element)

d) set.include(element)


Question 4:

What is the key difference between a set and a list in Python?

a) Sets are ordered, while lists are unordered

b) Sets are mutable, while lists are immutable

c) Sets can contain only numeric elements

d) Sets are unordered and do not allow duplicate elements


Question 5:

How do you check if an element is present in a set?

a) element in set

b) set.contains(element)

c) set.exists(element)

d) element.exists(set)


Question 6:

What happens when you try to add a duplicate element to a set?

a) The element is added successfully

b) Python raises an exception

c) The duplicate element is ignored, and the set remains unchanged

d) The set is automatically sorted


Question 7:

How do you remove an element from a set?

a) set.remove(element)

b) set.delete(element)

c) set.pop(element)

d) set.discard(element)


Question 8:

What is the purpose of the len() function when used with a set?

a) It returns the total number of elements in the set

b) It returns the last element of the set

c) It returns the length of each element in the set

d) It returns the sum of all elements in the set


Question 9:

How do you create a set with elements from 1 to 5 in Python?

a) set = {1, 2, 3, 4, 5}

b) set = range(1, 6)

c) set = set(1, 6)

d) set = {range(1, 6)}


Question 10:

What is the purpose of the pop() method in Python sets?

a) Removes the last element from the set

b) Removes a random element from the set and returns it

c) Removes the first occurrence of the specified element

d) Sorts the elements of the set


Question 11:

What is the difference between a set and a frozenset in Python?

a) Sets are mutable, while frozensets are immutable

b) Sets are unordered, while frozensets are ordered

c) Sets can contain only numeric elements

d) Sets allow duplicate elements, while frozensets do not


Question 12:

Which of the following statements is true regarding the union of two sets?

a) The union operator for sets is +

b) The union of two sets is the intersection of their elements

c) The union of two sets contains all unique elements from both sets

d) The union of two sets results in an empty set


Question 13:

What is the purpose of the clear() method in Python sets?

a) Clears all elements from the set

b) Returns a clear copy of the set

c) Clears only the first element from the set

d) Clears the set if a specific element is provided


Question 14:

Which method is used to find the intersection of two sets in Python?

a) set.intersection(set2)

b) set.intersect(set2)

c) set.common(set2)

d) set.and(set2)


Question 15:

What is the output of the following code?

set1 = {1, 2, 3}

set2 = {3, 4, 5}

result = set1.union(set2)

print(result)

a) {1, 2, 3, 4, 5}

b) {1, 2, 3}

c) {3, 4, 5}

d) {1, 2, 4, 5}


Question 16:

How do you check if a set is a subset of another set?

a) set.is_subset(other_set)

b) set.subset_of(other_set)

c) set.issubset(other_set)

d) set.contains_subset(other_set)


Question 17:

What does the difference() method do when applied to two sets?

a) Returns the union of the two sets

b) Returns the intersection of the two sets

c) Returns the difference between the two sets

d) Returns the symmetric difference between the two sets


Question 18:

What is the purpose of the symmetric_difference() method in Python sets?

a) Returns the union of the two sets

b) Returns the intersection of the two sets

c) Returns the difference between the two sets

d) Returns the symmetric difference between the two sets


Question 19:

What is the output of the following code?

set1 = {1, 2, 3}

set2 = {3, 4, 5}

result = set1.difference(set2)

print(result)

a) {1, 2, 3, 4, 5}

b) {1, 2}

c) {3}

d) {4, 5}


Question 20:

What is the purpose of the issuperset() method in Python sets?

a) Checks if the set is a proper superset of another set

b) Checks if the set is a subset of another set

c) Checks if the set is equal to another set

d) Checks if the set contains all elements of another set


Answer Key:

  1. b) A collection of unordered elements
  2. c) empty_set = set()
  3. b) set.add(element)
  4. d) Sets are unordered and do not allow duplicate elements
  5. a) element in set
  6. c) The duplicate element is ignored, and the set remains unchanged
  7. a) set.remove(element)
  8. a) It returns the total number of elements in the set
  9. a) set = {1, 2, 3, 4, 5}
  10. b) Removes a random element from the set and returns it
  11. a) Sets are mutable, while frozensets are immutable
  12. c) The union of two sets contains all unique elements from both sets
  13. a) Clears all elements from the set
  14. a) set.intersection(set2)
  15. a) {1, 2, 3, 4, 5}
  16. c) set.issubset(other_set)
  17. d) Returns the symmetric difference between the two sets
  18. d) Returns the symmetric difference between the two sets
  19. b) {1, 2}
  20. a) Checks if the set is a proper superset of another set

Friday 19 January 2024

Introducing Microsoft Power BI Alberto Ferrari and Marco Russo (Free PDF)

 


This is the eBook of the printed book and may not include any media, website access codes, or print supplements that may come packaged with the bound book.

Introducing Microsoft Power BI enables you to evaluate when and how to use Power BI. Get inspired to improve business processes in your company by leveraging the available analytical and collaborative features of this environment.

Be sure to watch for the publication of Alberto Ferrari and Marco Russo's upcoming retail book, Analyzing Data with Power BI and Power Pivot for Excel (ISBN 9781509302765).

Free PDF Download: Introducing Microsoft Power BI Alberto Ferrari and Marco Russo


Contents
Introduction ....................................................viii
Downloads.....................................................................xi
Installing the companion content ..................xii
Acknowledgments.....................................................xii
Free ebooks from Microsoft Press .................... xiv
Errata, updates, & book support....................... xiv
We want to hear from you.....................................xv
Stay in touch................................................................xv
Chapter 1: Introducing Power BI .....................1
Getting started with Power BI................................ 4
Uploading data to Power BI .................................10
Introducing natural-language queries .............13
Introducing Quick Insights....................................16
Introduction to reports...........................................22
Introducing Visual Interactions ...........................30
Decorating the report.............................................37
Saving the report......................................................40
Pinning a report.........................................................41
iv Contents
Refreshing the budget workbook ......................43
Filtering a report .......................................................50
Conclusions .................................................................55
Chapter 2: Sharing the dashboard.................57
Inviting a user to see a dashboard ....................58
Inviting users outside your organization....66
Creating a group workspace in Power BI........71
Turning on sharing with Microsoft OneDrive
for Business .................................................................76
Viewing reports and dashboards on mobile
devices...........................................................................94
Conclusions .............................................................. 101
Chapter 3: Understanding data refresh ..... 103
Introducing data refresh ..................................... 105
Introducing the Power BI refresh
architecture .............................................................. 107
Introducing Power BI Desktop.......................... 111
Publishing to Power BI......................................... 117
Installing the Power BI Personal Gateway.... 120
Configuring automatic refresh ......................... 128
Conclusions .............................................................. 130
Chapter 4: Using Power BI Desktop ........... 132
v Contents
Connecting to a database .................................. 134
Loading from multiple sources ........................ 141
Using Query Editor................................................ 145
Hiding or removing tables ................................. 159
Handling seasonality and sorting months... 163
Conclusions .............................................................. 179
Chapter 5: Getting data from services
and content packs ........................................ 181
Consuming a service content pack................. 183
Creating a custom dataset from a service ... 197
Creating a content pack for your
organization............................................................. 211
Consuming an organizational content
pack............................................................................. 216
Updating an organizational content pack ... 223
Conclusions .............................................................. 227
Chapter 6: Building a data model............... 230
Loading individual tables.................................... 232
Implementing measures ..................................... 236
Creating calculated columns............................. 239
Improving the report by using measures..... 242
Integrating budget information....................... 244
vi Contents
Reallocating the budget...................................... 256
Conclusions .............................................................. 262
Chapter 7: Improving Power BI reports ..... 264
Choosing the right visualizations .................... 267
Choosing between standard visuals.......... 274
Using custom visualizations .............................. 283
First steps with custom visualizations ....... 284
Improving reports by using custom
visualizations....................................................... 291
Identifying conditions when custom
visualizations are required............................. 299
Using DAX in data models ................................. 303
Creating high-density reports .......................... 311
Conclusions .............................................................. 320
Chapter 8: Using Microsoft Power BI
in your company........................................... 323
Getting data from existing systems................ 325
Understanding differences between
data refresh and live connections .............. 328
Using relational databases on-premises.. 330
Using relational databases in the cloud... 335
Using live connections to Analysis
Services ................................................................. 338
vii Contents
Integrating Power BI with Office...................... 340
Publish Excel data models in Power BI..... 340
Consume Power BI content from Excel .... 343
Using Power BI Tiles from Office Store .... 350
Managing security to access data................... 360
Using row-level security ................................. 364
Extending and customizing Power BI ............ 370
Creating custom visualizations for
Power BI................................................................ 371
Introducing the Power BI REST API............ 372
Pushing real-time data to Power BI
dashboards .......................................................... 376
Power BI embedded in applications.......... 381
Conclusions .............................................................. 383
About the authors........................................... 386

Power Bi Report Development Crash Course

 


What you'll learn

Create Relationship in PowerBI

Create Visualization in PowerBI 

Publish a report in powerbi service

Join Free: Power Bi Report Development Crash Course

About this Guided Project

Hello,

In this project, we will see in detail the steps required to create a PowerBI report using PowerBI Desktop and also we will publish this report on PowerBI service in the respective workspace. 

This project is designed for beginners who have no idea about PowerBI so they can quickly get a glimpse of how to create a report in PowerBI.

Pre-requisites:
- PowerBI Account

Here is a brief description of the tasks we are going to perform in this project:

Task1: Get Data
In this task we will first see an overview of PowerBI Desktop and then using PowerBI Desktop we will connect to the source data using the Get Data option. At the end of this task we would have imported all the source data in PowerBI Desktop

Task2: Create Relationship & Calculated Columns
In this task, we will create relationships between different source tables imported in PowerBI. In this process of creating relationship, we will also see how to created a calculated column using DAX query language.

Task3: Customize field level properties
In this task, we will explore and customize different field level properties like datatype, summarization, hidden etc.

Task4: Create visualizations in report
In this task, we will see how to create different visualizations in the report. We will also see how to add filters or slicers. We will explore visualizations like line chart, pie chart, table etc.

Task5: Publish report to PowerBI service
In all previous tasks, we have developed the report in PowerBI Desktop which is the local application installed on our desktop. In this task, we will see how to publish the task in power bi service. 

All The Best !!

Prepare, Clean, Transform, and Load Data using Power BI

 


What you'll learn

Prepare and Clean Data using Power BI

Transform and Load Data using Power BI

Join Free: Prepare, Clean, Transform, and Load Data using Power BI

About this Guided Project

Usually, tidy data is a mirage in a real-world setting. Additionally, before quality analysis can be done, data need to be in a proper format. This project-based course, "Prepare, Clean, Transform, and Load Data using Power BI" is for beginner and intermediate Power BI users willing to advance their knowledge and skills. 

In this course, you will learn practical ways for data cleaning and transformation using Power BI. We will talk about different data cleaning and transformation tasks like splitting, renaming, adding, removing columns. By the end of this 2-hour-long project, you will change data types, merge and append data sets. By extension, you will learn how to import data from the web and unpivot data.
This project-based course is a beginner to an intermediate-level course in Power BI. Therefore, to get the most of this project, it is essential to have a basic understanding of using a computer before you take this project.

Build an Income Statement Dashboard in Power BI

 


What you'll learn

Build an Income statement dashboard in Power BI

Visualize the income statement using cards, table and column charts

Transform & clean data in the Power Query editor

Join Free: Build an Income Statement Dashboard in Power BI

About this Guided Project

In this 1.5 hours long project, we will be creating an income statement dashboard filled with relevant charts and data. Power BI dashboards are an amazing way to visualize data and make them interactive.  We will begin this guided project by importing the data and transforming it in the Power Query editor. We will then visualize the Income Statement using a table, visualize total revenue, operating income and net income using cards and in the final task visualize the year on year growth using clustered column charts. This project is for anyone who is interested in Power BI and data visualization and specially for those who work in accounts and finance departments. By the end of this course, you will be confident in creating financial statement dashboards with many different kinds of visualizations.

Create a Sales Dashboard using Power BI

 


What you'll learn

Build an attractive and interactive sales dashboard with all the necessary visualizations in a black and blue theme

Visualize sales data using bar charts & pie charts

Create interactive maps to visualize sales data by countries and markets

Join Free: Create a Sales Dashboard using Power BI

About this Guided Project

In this 1 hour long project, you will build an attractive and eye-catching sales dashboard using Power BI in a black and blue theme that will make your audience go "wow". We will begin this guided project by importing data. We will then create bar charts and pie charts to visualize the sales data and then position the graphs on the dashboard. In the final tasks, we will create interactive maps to visualize sales data by countries and markets. By the end of this course, you will be confident in creating beautiful dashboards with many different kinds of visualizations.

HR Analytics- Build an HR dashboard using Power BI

 


What you'll learn

Build an attractive and eye-catching HR dashboard

Visualize gender & racial diversity using graphs & charts in Power BI

Explore buttons, themes, filters & slicers to make the dashboard interactive & smart

Join Free: HR Analytics- Build an HR dashboard using Power BI

About this Guided Project

In this 1 hour long project, you will build an attractive and eye-catching HR dashboard using Power BI. We will begin this guided project by importing data & creating an employee demographics page that gives us the overall demographic outlook of the organization. We will then create pie charts and doughnut charts to visualize gender & racial diversity. In the final tasks, we will create an employee detail page that will provide you with all the important information about any employee with just a click. We will also explore buttons, themes, slicers & filters to make the dashboard more interactive & useful. By the end of this course, you will be confident in creating beautiful HR dashboards that you can use for your personal or organizational purpose.

Data-Driven Decisions with Power BI

 


There are 5 modules in this course

New Power BI users will begin the course by gaining a conceptual understanding of the Power BI desktop application and the Power BI service. Learners will explore the Power BI interface while learning how to manage pages and understand the basics of visualizations.  Learners can download a course dataset and engage in numerous hands-on experiences to discover how to import, connect, clean, transform, and model their own data in the Power BI desktop application.

Join Free: Data-Driven Decisions with Power BI

 Learners will investigate reports, learn about workspaces, and practice viewing, creating, and publishing reports to the Power BI service. Finally, learners will become proficient in the creation and utilization dashboards.

Use Power Bi for Financial Data Analysis


 What you'll learn

Navigate and understand the process of importing data into Power Bi.

Use Power Query to clean data before constructing visuals and reports. Determine relationships between data and use reference tables in Power Bi.

Create and design a reporting dashboard with dynamic features. Publish and share your report

Join Free:Use Power Bi for Financial Data Analysis

About this Guided Project

In this project, learners will have a guided look through Power Bi dynamic reports and visualizations for financial data analysis. As you view, load, and transform your data in Power Bi, you will learn which steps are key to making an effective financial report dashboard and how to connect your report for dynamic visualizations. Data reporting and visualization is the most critical step in a financial, business, or data analyst’s functions. The data is only as effective if it can be communicated effectively to key stakeholders in the organization. Effective communication of data starts here.

Build Dashboards in Power BI

 


What you'll learn

Build a Dashboard in Power BI by building a report and visuals.

Build a report with visuals.

Create a dashboard and pin visuals.

Join Free: Build Dashboards in Power BI

About this Guided Project

In this project, you will create a Dashboard in Power BI. You will get data to bring into a model, build several reports, generate informative charts from each report, then choose powerful visuals to highlight on a Dashboard. Your new skills will help you efficiently summarize important information on a one-page dashboard with visual data.

Getting Started with Power BI Desktop

 


What you'll learn

Import and Transform Data with Power BI Desktop

Visualize Data with Power BI Desktop

Join Free: Getting Started with Power BI Desktop

About this Guided Project

In this 2-hour long project-based course, you will learn the basics of using Power BI Desktop software. We will do this by analyzing data on credit card defaults with Power BI Desktop. Power BI Desktop is a free Business Intelligence application from Microsoft that lets you load, transform, and visualize data. You can create interactive reports and dashboards quite easily, and quickly. We will learn some of the basics of Power BI by importing, transforming, and visualizing the data.

This course is aimed at learners who are looking to get started with the Power BI Desktop software. There are no hard prerequisites and any competent computer user should be able to complete the project successfully.

Note: This course works best for learners who are based in the North America region. We’re currently working on providing the same experience in other regions.

Top 20 Python Tuple Questions

 



What is a tuple in Python?

a) A collection of unordered elements

b) A collection of ordered elements

c) A single element

d) A data type


Question 2:

How do you create an empty tuple in Python?

a) tuple()

b) empty_tuple = ()

c) empty_tuple = tuple()

d) Both b and c


Question 3:

How do you access the first element of a tuple?

a) tuple[0]

b) tuple.first()

c) tuple.first

d) tuple.get(0)


Question 4:

Which of the following statements is used to add an element to a tuple?

a) tuple.insert(0, element)

b) Tuples are immutable, so elements cannot be added once a tuple is created

c) tuple.add(element)

d) tuple.extend(element)


Question 5:

What is the key difference between a tuple and a list in Python?

a) Tuples are mutable, while lists are immutable

b) Tuples are ordered, while lists are unordered

c) Tuples are immutable, while lists are mutable

d) Tuples can contain only numeric elements


Question 6:

How do you check if an element is present in a tuple?

a) element in tuple

b) tuple.contains(element)

c) tuple.exists(element)

d) element.exists(tuple)


Question 7:

What does the tuple.count(element) method do?

a) Counts the total number of elements in the tuple

b) Counts the occurrences of a specific element in the tuple

c) Counts the sum of all elements in the tuple

d) Counts the average value of elements in the tuple


Question 8:

How do you concatenate two tuples in Python?

a) tuple1 + tuple2

b) tuple1.concat(tuple2)

c) concat(tuple1, tuple2)

d) combine(tuple1, tuple2)


Question 9:

How do you create a tuple with a single element?

a) single_tuple = (1)

b) single_tuple = 1,

c) single_tuple = (1,)

d) Both a and b


Question 10:

Which method is used to find the index of the first occurrence of a specified element in a tuple?

a) tuple.index(element)

b) tuple.find(element)

c) tuple.search(element)

d) tuple.loc(element)


Question 11:

What happens when you try to modify an element in a tuple?

a) It is not possible to modify elements in a tuple as they are immutable

b) The element is updated successfully

c) Python raises an exception

d) The element is deleted from the tuple


Question 12:

How do you create a tuple with elements from 1 to 5 in Python?

a) tuple = (1, 2, 3, 4, 5)

b) tuple = range(1, 6)

c) tuple = tuple(1, 6)

d) tuple = (range(1, 6))


Question 13:

What is the purpose of the len() function when used with a tuple?

a) It returns the total number of elements in the tuple

b) It returns the last element of the tuple

c) It returns the length of each element in the tuple

d) It returns the sum of all elements in the tuple


Question 14:

How do you check if two tuples are equal?

a) tuple1.is_equal(tuple2)

b) tuple1 == tuple2

c) tuple1.equals(tuple2)

d) tuple1.equals(tuple2, strict=True)


Question 15:

What is the purpose of the max() function when used with a tuple?

a) It returns the maximum element in the tuple

b) It returns the index of the maximum element in the tuple

c) It returns the sum of all elements in the tuple

d) It returns the average value of elements in the tuple


Question 16:

Which method is used to remove the last element from a tuple?

a) tuple.remove_last()

b) tuple.pop()

c) tuple.delete_last()

d) Tuples are immutable, so elements cannot be removed


Question 17:

How do you convert a list to a tuple in Python?

a) tuple(list)

b) tuple = list

c) tuple.from_list(list)

d) tuple.convert(list)


Question 18:

What is the purpose of the sorted() function when applied to a tuple?

a) Reverses the order of elements in the tuple

b) Sorts the elements of the tuple in ascending order

c) Removes duplicate elements from the tuple

d) Shuffles the elements of the tuple randomly


Question 19:

What does the tuple.index(element) method return if the element is not found in the tuple?

a) None

b) -1

c) 0

d) Raises a ValueError


Question 20:

What is the output of the following code?

my_tuple = (3, 1, 4, 1, 5, 9, 2)

my_tuple.sort()

print(my_tuple)

a) (1, 1, 2, 3, 4, 5, 9)

b) (9, 5, 4, 3, 2, 1, 1)

c) (1, 1, 2, 3, 4, 5, 9, 2)

d) (1, 2, 3, 4, 5, 9)


Answer: 

  1. b) A collection of ordered elements
  2. d) Both b and c
  3. a) tuple[0]
  4. b) Tuples are immutable, so elements cannot be added once a tuple is created
  5. c) Tuples are immutable, while lists are mutable
  6. a) element in tuple
  7. b) Counts the occurrences of a specific element in the tuple
  8. a) tuple1 + tuple2
  9. c) single_tuple = (1,)
  10. a) tuple.index(element)
  11. a) It is not possible to modify elements in a tuple as they are immutable
  12. a) tuple = (1, 2, 3, 4, 5)
  13. a) It returns the total number of elements in the tuple
  14. b) tuple1 == tuple2
  15. a) It returns the maximum element in the tuple
  16. d) Tuples are immutable, so elements cannot be removed
  17. a) tuple(list)
  18. b) Sorts the elements of the tuple in ascending order
  19. d) Raises a ValueError
  20. d) (1, 2, 3, 4, 5, 9)

The Big Book of Small Python Projects: 81 Easy Practice Programs

 


Best-selling author Al Sweigart shows you how to easily build over 80 fun programs with minimal code and maximum creativity.

If you’ve mastered basic Python syntax and you’re ready to start writing programs, you’ll find The Big Book of Small Python Projects both enlightening and fun. This collection of 81 Python projects will have you making digital art, games, animations, counting pro- grams, and more right away. Once you see how the code works, you’ll practice re-creating the programs and experiment by adding your own custom touches.

These simple, text-based programs are 256 lines of code or less. And whether it’s a vintage screensaver, a snail-racing game, a clickbait headline generator, or animated strands of DNA, each project is designed to be self-contained so you can easily share it online.

You’ll create:

• Hangman, Blackjack, and other games to play against your friends or the computer

• Simulations of a forest fire, a million dice rolls, and a Japanese abacus

• Animations like a virtual fish tank, a rotating cube, and a bouncing DVD logo screensaver

• A first-person 3D maze game

• Encryption programs that use ciphers like ROT13 and Vigenère to conceal text

If you’re tired of standard step-by-step tutorials, you’ll love the learn-by-doing approach of The Big Book of Small Python Projects. It’s proof that good things come in small programs!

Hard Copy : The Big Book of Small Python Projects: 81 Easy Practice Programs





Thursday 18 January 2024

Top 20 Python List Questions




Question 1:

What is a list in Python?

a) A collection of unordered elements

b) A collection of ordered elements

c) A single element

d) A data type


Question 2:

How do you create an empty list in Python?

a) list()

b) empty_list = []

c) empty_list = list()

d) Both b and c


Question 3:

How do you access the first element of a list?

a) list[0]

b) list.first()

c) list.first

d) list.get(0)


Question 4:

Which of the following statements is used to add an element to the end of a list?

a) list.insert(0, element)

b) list.add(element)

c) list.append(element)

d) list.extend(element)


Question 5:

What is the purpose of the len() function when used with a list?

a) It returns the total number of elements in the list

b) It returns the last element of the list

c) It returns the length of each element in the list

d) It returns the sum of all elements in the list


Question 6:

How do you check if an element is present in a list?

a) element in list

b) list.contains(element)

c) list.exists(element)

d) element.exists(list)


Question 7:

What does the list.remove(element) function do?

a) Removes the first occurrence of the specified element from the list

b) Removes all occurrences of the specified element from the list

c) Removes the last element from the list

d) Removes the element at the specified index


Question 8:

How do you reverse the order of elements in a list?

a) list.reverse()

b) list.sort(reverse=True)

c) list.reorder()

d) list.flip()


Question 9:

What is the difference between the append() and extend() methods in Python lists?

a) There is no difference, and the terms are interchangeable

b) append() adds a single element, while extend() adds multiple elements

c) extend() adds a single element, while append() adds multiple elements

d) Both methods are used for removing elements from a list


Question 10:

What is the output of the following code?

my_list = [1, 2, 3]

new_list = my_list * 2

print(new_list)

a) [1, 2, 3, 1, 2, 3]

b) [2, 4, 6]

c) [1, 4, 9]

d) [1, 2, 3, 6, 9]


Question 11:

Which method is used to find the index of the first occurrence of a specified element in a list?

a) list.index(element)

b) list.find(element)

c) list.search(element)

d) list.loc(element)


Question 12:

How do you copy the elements of one list to another list in Python?

a) new_list = old_list.copy()

b) new_list = old_list.clone()

c) new_list = copy(old_list)

d) new_list = old_list[:]


Question 13:

What is the purpose of the pop() method in Python lists?

a) Adds an element to the end of the list

b) Removes the last element from the list and returns it

c) Removes the first occurrence of the specified element

d) Sorts the elements of the list


Question 14:

What is the difference between a list and a tuple in Python?

a) Lists are mutable, while tuples are immutable

b) Lists are immutable, while tuples are mutable

c) Both lists and tuples are mutable

d) Both lists and tuples are immutable


Question 15:

How do you insert an element at a specific index in a list?

a) list.add(index, element)

b) list.insert(index, element)

c) list.insert(element, index)

d) list.put(index, element)


Question 16:

Which method is used to clear all elements from a list?

a) list.clear()

b) list.remove_all()

c) list.delete()

d) list.empty()


Question 17:

What does the sorted() function do when applied to a list?


a) Reverses the order of elements in the list

b) Sorts the elements of the list in ascending order

c) Removes duplicate elements from the list

d) Shuffles the elements of the list randomly


Question 18:

What is the purpose of the count() method in Python lists?

a) Counts the total number of elements in the list

b) Counts the occurrences of a specific element in the list

c) Counts the sum of all elements in the list

d) Counts the average value of elements in the list


Question 19:

How do you create a list of numbers from 1 to 5 in Python?

a) list = [1, 2, 3, 4, 5]

b) list = range(1, 6)

c) list = list(1, 6)

d) list = [range(1, 6)]


Question 20:

What is the output of the following code?

my_list = [3, 1, 4, 1, 5, 9, 2]

my_list.sort()

print(my_list)

a) [1, 1, 2, 3, 4, 5, 9]

b) [9, 5, 4, 3, 2, 1, 1]

c) [1, 1, 2, 3, 4, 5, 9, 2]

d) [1, 2, 3, 4, 5, 9]


Answer : 

Question 1: b) A collection of ordered elements

Question 2: d) Both b and c

Question 3: a) list[0]

Question 4: c) list.append(element)

Question 5: a) It returns the total number of elements in the list

Question 6: a) element in list

Question 7: a) Removes the first occurrence of the specified element from the list

Question 8: a) list.reverse()

Question 9: b) append() adds a single element, while extend() adds multiple elements

Question 10: a) [1, 2, 3, 1, 2, 3]

Question 11: a) list.index(element)

Question 12: d) new_list = old_list[:]

Question 13: b) Removes the last element from the list and returns it

Question 14: a) Lists are mutable, while tuples are immutable

Question 15: b) list.insert(index, element)

Question 16: a) list.clear()

Question 17: b) Sorts the elements of the list in ascending order

Question 18: b) Counts the occurrences of a specific element in the list

Question 19: b) list = range(1, 6)

Question 20: a) [1, 1, 2, 3, 4, 5, 9]

Popular Posts

Categories

AI (27) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (118) C (77) C# (12) C++ (82) Course (62) Coursera (180) Cybersecurity (22) data management (11) Data Science (95) Data Strucures (6) Deep Learning (9) Django (6) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flutter (1) FPL (17) Google (19) Hadoop (3) HTML&CSS (46) IBM (25) IoT (1) IS (25) Java (92) Leet Code (4) Machine Learning (44) Meta (18) MICHIGAN (5) microsoft (4) Pandas (3) PHP (20) Projects (29) Python (753) Python Coding Challenge (230) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (2) Software (17) SQL (40) UX Research (1) web application (8)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses