You don't need to know everything about every data tool. Focus on what will help land you your job.
For Excel:
- IFS (all variations)
- XLOOKUP
- IMPORTRANGE (in GSheets)
- Pivot Tables
- Dynamic functions like TODAY()
For SQL:
- Sum
- Group By
- Window Functions
- CTEs
- Joins
For Tableau:
- Calculated Columns
- Sets
- Groups
- Formatting
For Power BI:
- Power Query for data transformation
- DAX (Data Analysis Expressions) for creating custom calculations
- Relationships between tables
- Creating interactive and dynamic dashboards
- Utilizing slicers and filters effectively
I have created 100-Day Roadmap & Resources for Data Analyst 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
For Excel:
- IFS (all variations)
- XLOOKUP
- IMPORTRANGE (in GSheets)
- Pivot Tables
- Dynamic functions like TODAY()
For SQL:
- Sum
- Group By
- Window Functions
- CTEs
- Joins
For Tableau:
- Calculated Columns
- Sets
- Groups
- Formatting
For Power BI:
- Power Query for data transformation
- DAX (Data Analysis Expressions) for creating custom calculations
- Relationships between tables
- Creating interactive and dynamic dashboards
- Utilizing slicers and filters effectively
I have created 100-Day Roadmap & Resources for Data Analyst 👇👇
https://whatsapp.com/channel/0029VaGgzAk72WTmQFERKh02
Hope it helps :)
❤6👍4
30-day roadmap to learn Python up to an intermediate level
Week 1: Python Basics
*Day 1-2:*
- Learn about Python, its syntax, and how to install Python on your computer.
- Write your first "Hello, World!" program.
- Understand variables and data types (integers, floats, strings).
*Day 3-4:*
- Explore basic operations (arithmetic, string concatenation).
- Learn about user input and how to use the
- Practice creating and using variables.
*Day 5-7:*
- Dive into control flow with if statements, else statements, and loops (for and while).
- Work on simple programs that involve conditions and loops.
Week 2: Functions and Modules
*Day 8-9:*
- Study functions and how to define your own functions using
- Learn about function arguments and return values.
*Day 10-12:*
- Explore built-in functions and libraries (e.g.,
- Understand how to import modules and use their functions.
*Day 13-14:*
- Practice writing functions for common tasks.
- Create a small project that utilizes functions and modules.
Week 3: Data Structures
*Day 15-17:*
- Learn about lists and their operations (slicing, appending, removing).
- Understand how to work with lists of different data types.
*Day 18-19:*
- Study dictionaries and their key-value pairs.
- Practice manipulating dictionary data.
*Day 20-21:*
- Explore tuples and sets.
- Understand when and how to use each data structure.
Week 4: Intermediate Topics
*Day 22-23:*
- Study file handling and how to read/write files in Python.
- Work on projects involving file operations.
*Day 24-26:*
- Learn about exceptions and error handling.
- Explore object-oriented programming (classes and objects).
*Day 27-28:*
- Dive into more advanced topics like list comprehensions and generators.
- Study Python's built-in libraries for web development (e.g., requests).
*Day 29-30:*
- Explore additional libraries and frameworks relevant to your interests (e.g., NumPy for data analysis, Flask for web development, or Pygame for game development).
- Work on a more complex project that combines your knowledge from the past weeks.
Throughout the 30 days, practice coding daily, and don't hesitate to explore Python's documentation and online resources for additional help. You can refer this guide to help you with interview preparation.
Good luck with your Python journey 😄👍
Week 1: Python Basics
*Day 1-2:*
- Learn about Python, its syntax, and how to install Python on your computer.
- Write your first "Hello, World!" program.
- Understand variables and data types (integers, floats, strings).
*Day 3-4:*
- Explore basic operations (arithmetic, string concatenation).
- Learn about user input and how to use the
input() function.- Practice creating and using variables.
*Day 5-7:*
- Dive into control flow with if statements, else statements, and loops (for and while).
- Work on simple programs that involve conditions and loops.
Week 2: Functions and Modules
*Day 8-9:*
- Study functions and how to define your own functions using
def.- Learn about function arguments and return values.
*Day 10-12:*
- Explore built-in functions and libraries (e.g.,
len(), random, math).- Understand how to import modules and use their functions.
*Day 13-14:*
- Practice writing functions for common tasks.
- Create a small project that utilizes functions and modules.
Week 3: Data Structures
*Day 15-17:*
- Learn about lists and their operations (slicing, appending, removing).
- Understand how to work with lists of different data types.
*Day 18-19:*
- Study dictionaries and their key-value pairs.
- Practice manipulating dictionary data.
*Day 20-21:*
- Explore tuples and sets.
- Understand when and how to use each data structure.
Week 4: Intermediate Topics
*Day 22-23:*
- Study file handling and how to read/write files in Python.
- Work on projects involving file operations.
*Day 24-26:*
- Learn about exceptions and error handling.
- Explore object-oriented programming (classes and objects).
*Day 27-28:*
- Dive into more advanced topics like list comprehensions and generators.
- Study Python's built-in libraries for web development (e.g., requests).
*Day 29-30:*
- Explore additional libraries and frameworks relevant to your interests (e.g., NumPy for data analysis, Flask for web development, or Pygame for game development).
- Work on a more complex project that combines your knowledge from the past weeks.
Throughout the 30 days, practice coding daily, and don't hesitate to explore Python's documentation and online resources for additional help. You can refer this guide to help you with interview preparation.
Good luck with your Python journey 😄👍
👍10
🌟 Data Analyst vs Business Analyst: Quick comparison 🌟
1. Data Analyst: Dives into data, cleans it up, and finds hidden insights like Sherlock Holmes. 🕵️♂️
Business Analyst: Talks to stakeholders, defines requirements, and ensures everyone’s on the same page. The diplomat. 🤝
2. Data Analyst: Master of Excel, SQL, Python, and dashboards. Their life is rows, columns, and code. 📊
Business Analyst: Fluent in meetings, presentations, and documentation. Their life is all about people and processes. 🗂️
3. Data Analyst: Focuses on numbers, patterns, and trends to tell a story with data. 📈
Business Analyst: Focuses on the "why" behind the numbers to help the business make decisions. 💡
4. Data Analyst: Creates beautiful Power BI or Tableau dashboards that wow stakeholders. 🎨
Business Analyst: Uses those dashboards to present actionable insights to the C-suite. 🎤
5. Data Analyst: SQL queries, Python noscripts, and statistical models are their weapons. 🛠️
Business Analyst: Process diagrams, requirement docs, and communication are their superpowers. 🦸♂️
6. Data Analyst: “Why is revenue declining? Let me analyze the sales data.”
Business Analyst: “Why is revenue declining? Let’s talk to the sales team and fix the process.”
7. Data Analyst: Works behind the scenes, crunching data and making sense of numbers. 🔢
Business Analyst: Works with teams to ensure that processes, strategies, and technologies align with business goals. 🎯
8. Data Analyst: Uses data to make decisions—raw data is their best friend. 📉
Business Analyst: Uses data to support business decisions and recommends solutions to improve processes. 📝
9. Data Analyst: Aims for accuracy, precision, and statistical significance in every analysis. 🧮
Business Analyst: Aims to understand business needs, optimize workflows, and align solutions with business objectives. 🏢
10. Data Analyst: Focuses on extracting insights from data for current or historical analysis. 🔍
Business Analyst: Looks forward, aligning business strategies with long-term goals and improvements. 🌱
Both roles are vital, but they approach the data world in their unique ways.
Like this post for more content like this 👍♥️
Share with credits: https://news.1rj.ru/str/sqlspecialist
Hope it helps :)
1. Data Analyst: Dives into data, cleans it up, and finds hidden insights like Sherlock Holmes. 🕵️♂️
Business Analyst: Talks to stakeholders, defines requirements, and ensures everyone’s on the same page. The diplomat. 🤝
2. Data Analyst: Master of Excel, SQL, Python, and dashboards. Their life is rows, columns, and code. 📊
Business Analyst: Fluent in meetings, presentations, and documentation. Their life is all about people and processes. 🗂️
3. Data Analyst: Focuses on numbers, patterns, and trends to tell a story with data. 📈
Business Analyst: Focuses on the "why" behind the numbers to help the business make decisions. 💡
4. Data Analyst: Creates beautiful Power BI or Tableau dashboards that wow stakeholders. 🎨
Business Analyst: Uses those dashboards to present actionable insights to the C-suite. 🎤
5. Data Analyst: SQL queries, Python noscripts, and statistical models are their weapons. 🛠️
Business Analyst: Process diagrams, requirement docs, and communication are their superpowers. 🦸♂️
6. Data Analyst: “Why is revenue declining? Let me analyze the sales data.”
Business Analyst: “Why is revenue declining? Let’s talk to the sales team and fix the process.”
7. Data Analyst: Works behind the scenes, crunching data and making sense of numbers. 🔢
Business Analyst: Works with teams to ensure that processes, strategies, and technologies align with business goals. 🎯
8. Data Analyst: Uses data to make decisions—raw data is their best friend. 📉
Business Analyst: Uses data to support business decisions and recommends solutions to improve processes. 📝
9. Data Analyst: Aims for accuracy, precision, and statistical significance in every analysis. 🧮
Business Analyst: Aims to understand business needs, optimize workflows, and align solutions with business objectives. 🏢
10. Data Analyst: Focuses on extracting insights from data for current or historical analysis. 🔍
Business Analyst: Looks forward, aligning business strategies with long-term goals and improvements. 🌱
Both roles are vital, but they approach the data world in their unique ways.
Like this post for more content like this 👍♥️
Share with credits: https://news.1rj.ru/str/sqlspecialist
Hope it helps :)
👍6👏2
Python Interview Questions for data analyst interview
Question 1: Find the top 5 dates when the percentage change in Company A's stock price was the highest.
Question 2: Calculate the annualized volatility of Company B's stock price. (Hint: Annualized volatility is the standard deviation of daily returns multiplied by the square root of the number of trading days in a year.)
Question 3: Identify the longest streaks of consecutive days when the stock price of Company A was either increasing or decreasing continuously.
Question 4: Create a new column that represents the cumulative returns of Company A's stock price over the year.
Question 5: Calculate the 7-day rolling average of both Company A's and Company B's stock prices and find the date when the two rolling averages were closest to each other.
Question 6: Create a new DataFrame that contains only the dates when Company A's stock price was above its 50-day moving average, and Company B's stock price was below its 50-day moving average
Hope you'll like it
Like this post if you need more resources like this 👍❤️
#Python
Question 1: Find the top 5 dates when the percentage change in Company A's stock price was the highest.
Question 2: Calculate the annualized volatility of Company B's stock price. (Hint: Annualized volatility is the standard deviation of daily returns multiplied by the square root of the number of trading days in a year.)
Question 3: Identify the longest streaks of consecutive days when the stock price of Company A was either increasing or decreasing continuously.
Question 4: Create a new column that represents the cumulative returns of Company A's stock price over the year.
Question 5: Calculate the 7-day rolling average of both Company A's and Company B's stock prices and find the date when the two rolling averages were closest to each other.
Question 6: Create a new DataFrame that contains only the dates when Company A's stock price was above its 50-day moving average, and Company B's stock price was below its 50-day moving average
Hope you'll like it
Like this post if you need more resources like this 👍❤️
#Python
👍3❤1
Python is a popular programming language in the field of data analysis due to its versatility, ease of use, and extensive libraries for data manipulation, visualization, and analysis. Here are some key Python skills that are important for data analysts:
1. Basic Python Programming: Understanding basic Python syntax, data types, control structures, functions, and object-oriented programming concepts is essential for data analysis in Python.
2. NumPy: NumPy is a fundamental package for scientific computing in Python. It provides support for large multidimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays.
3. Pandas: Pandas is a powerful library for data manipulation and analysis in Python. It provides data structures like DataFrames and Series that make it easy to work with structured data and perform tasks such as filtering, grouping, joining, and reshaping data.
4. Matplotlib and Seaborn: Matplotlib is a versatile library for creating static, interactive, and animated visualizations in Python. Seaborn is built on top of Matplotlib and provides a higher-level interface for creating attractive statistical graphics.
5. Scikit-learn: Scikit-learn is a popular machine learning library in Python that provides tools for building predictive models, performing clustering and classification tasks, and evaluating model performance.
6. Jupyter Notebooks: Jupyter Notebooks are an interactive computing environment that allows you to create and share documents containing live code, equations, visualizations, and narrative text. They are commonly used by data analysts for exploratory data analysis and sharing insights.
7. SQLAlchemy: SQLAlchemy is a Python SQL toolkit and Object-Relational Mapping (ORM) library that provides a high-level interface for interacting with relational databases using Python.
8. Regular Expressions: Regular expressions (regex) are powerful tools for pattern matching and text processing in Python. They are useful for extracting specific information from text data or performing data cleaning tasks.
9. Data Visualization Libraries: In addition to Matplotlib and Seaborn, data analysts may also use other visualization libraries like Plotly, Bokeh, or Altair to create interactive visualizations in Python.
10. Web Scraping: Knowledge of web scraping techniques using libraries like BeautifulSoup or Scrapy can be useful for collecting data from websites for analysis.
By mastering these Python skills and applying them to real-world data analysis projects, you can enhance your proficiency as a data analyst and unlock new opportunities in the field.
#Python
1. Basic Python Programming: Understanding basic Python syntax, data types, control structures, functions, and object-oriented programming concepts is essential for data analysis in Python.
2. NumPy: NumPy is a fundamental package for scientific computing in Python. It provides support for large multidimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays.
3. Pandas: Pandas is a powerful library for data manipulation and analysis in Python. It provides data structures like DataFrames and Series that make it easy to work with structured data and perform tasks such as filtering, grouping, joining, and reshaping data.
4. Matplotlib and Seaborn: Matplotlib is a versatile library for creating static, interactive, and animated visualizations in Python. Seaborn is built on top of Matplotlib and provides a higher-level interface for creating attractive statistical graphics.
5. Scikit-learn: Scikit-learn is a popular machine learning library in Python that provides tools for building predictive models, performing clustering and classification tasks, and evaluating model performance.
6. Jupyter Notebooks: Jupyter Notebooks are an interactive computing environment that allows you to create and share documents containing live code, equations, visualizations, and narrative text. They are commonly used by data analysts for exploratory data analysis and sharing insights.
7. SQLAlchemy: SQLAlchemy is a Python SQL toolkit and Object-Relational Mapping (ORM) library that provides a high-level interface for interacting with relational databases using Python.
8. Regular Expressions: Regular expressions (regex) are powerful tools for pattern matching and text processing in Python. They are useful for extracting specific information from text data or performing data cleaning tasks.
9. Data Visualization Libraries: In addition to Matplotlib and Seaborn, data analysts may also use other visualization libraries like Plotly, Bokeh, or Altair to create interactive visualizations in Python.
10. Web Scraping: Knowledge of web scraping techniques using libraries like BeautifulSoup or Scrapy can be useful for collecting data from websites for analysis.
By mastering these Python skills and applying them to real-world data analysis projects, you can enhance your proficiency as a data analyst and unlock new opportunities in the field.
#Python
👍10❤2
🐍 Master Python for Data Analytics!
Python is a powerful tool for data analysis, automation, and visualization. Here’s the ultimate roadmap:
🔹 Basic Concepts:
➡️ Syntax, variables, and data types (integers, floats, strings, booleans)
➡️ Control structures (if-else, for and while loops)
➡️ Basic data structures (lists, dictionaries, sets, tuples)
➡️ Functions, lambda functions, and error handling (try-except)
➡️ Working with modules and packages
🔹 Pandas & NumPy:
➡️ Creating and manipulating DataFrames and arrays
➡️ Data filtering, aggregation, and reshaping
➡️ Handling missing values
➡️ Efficient data operations with NumPy
🔹 Data Visualization:
➡️ Creating visualizations using Matplotlib and Seaborn
➡️ Plotting line, bar, scatter, and heatmaps
#Python
Python is a powerful tool for data analysis, automation, and visualization. Here’s the ultimate roadmap:
🔹 Basic Concepts:
➡️ Syntax, variables, and data types (integers, floats, strings, booleans)
➡️ Control structures (if-else, for and while loops)
➡️ Basic data structures (lists, dictionaries, sets, tuples)
➡️ Functions, lambda functions, and error handling (try-except)
➡️ Working with modules and packages
🔹 Pandas & NumPy:
➡️ Creating and manipulating DataFrames and arrays
➡️ Data filtering, aggregation, and reshaping
➡️ Handling missing values
➡️ Efficient data operations with NumPy
🔹 Data Visualization:
➡️ Creating visualizations using Matplotlib and Seaborn
➡️ Plotting line, bar, scatter, and heatmaps
#Python
👍5
Iterating over Pandas DataFrames can cost you much performance.
Comparing iterrows() and itertuples() can help in some cases:
1. 𝗶𝘁𝗲𝗿𝗿𝗼𝘄𝘀():
Generates index and Series pairs for each row.
𝗣𝗿𝗼𝘀: Easy to use and intuitive. Suitable for small datasets.
𝗖𝗼𝗻𝘀: Slow for large datasets. Series conversion incurs additional overhead.
𝗨𝘀𝗲 𝗖𝗮𝘀𝗲: Quick data inspection and small-scale transformations.
2. 𝗶𝘁𝗲𝗿𝘁𝘂𝗽𝗹𝗲𝘀():
Returns namedtuples of the DataFrame rows.
𝗣𝗿𝗼𝘀: Much faster than iterrows(). More efficient for large datasets.
𝗖𝗼𝗻𝘀: Slightly less intuitive syntax. Avoid using when mutating DataFrames.
𝗨𝘀𝗲 𝗖𝗮𝘀𝗲: Large-scale data processing and read-only operations.
For optimal performance, use vectorized operations whenever possible! Iteration methods should be your last resort!
Comparing iterrows() and itertuples() can help in some cases:
1. 𝗶𝘁𝗲𝗿𝗿𝗼𝘄𝘀():
Generates index and Series pairs for each row.
𝗣𝗿𝗼𝘀: Easy to use and intuitive. Suitable for small datasets.
𝗖𝗼𝗻𝘀: Slow for large datasets. Series conversion incurs additional overhead.
𝗨𝘀𝗲 𝗖𝗮𝘀𝗲: Quick data inspection and small-scale transformations.
2. 𝗶𝘁𝗲𝗿𝘁𝘂𝗽𝗹𝗲𝘀():
Returns namedtuples of the DataFrame rows.
𝗣𝗿𝗼𝘀: Much faster than iterrows(). More efficient for large datasets.
𝗖𝗼𝗻𝘀: Slightly less intuitive syntax. Avoid using when mutating DataFrames.
𝗨𝘀𝗲 𝗖𝗮𝘀𝗲: Large-scale data processing and read-only operations.
For optimal performance, use vectorized operations whenever possible! Iteration methods should be your last resort!
𝐒𝐭𝐫𝐢𝐧𝐠 𝐌𝐚𝐧𝐢𝐩𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐢𝐧 𝐏𝐲𝐭𝐡𝐨𝐧:
Strings in Python are immutable sequences of characters.
𝟏- 𝐥𝐞𝐧(): 𝐑𝐞𝐭𝐮𝐫𝐧𝐬 𝐭𝐡𝐞 𝐥𝐞𝐧𝐠𝐭𝐡 𝐨𝐟 𝐭𝐡𝐞 𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "Hello"
length = len(my_string) # length will be 5
𝟐- 𝐬𝐭𝐫(): 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐬 𝐧𝐨𝐧-𝐬𝐭𝐫𝐢𝐧𝐠 𝐝𝐚𝐭𝐚 𝐭𝐲𝐩𝐞𝐬 𝐢𝐧𝐭𝐨 𝐬𝐭𝐫𝐢𝐧𝐠𝐬.
num = 123
str_num = str(num) # str_num will be "123"
𝟑- 𝐥𝐨𝐰𝐞𝐫() 𝐚𝐧𝐝 𝐮𝐩𝐩𝐞𝐫(): 𝐂𝐨𝐧𝐯𝐞𝐫𝐭 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐭𝐨 𝐥𝐨𝐰𝐞𝐫𝐜𝐚𝐬𝐞 𝐨𝐫 𝐮𝐩𝐩𝐞𝐫𝐜𝐚𝐬𝐞.
my_string = "Hello"
lower_case = my_string.lower() # lower_case will be "hello"
upper_case = my_string.upper() # upper_case will be "HELLO"
𝟒- 𝐬𝐭𝐫𝐢𝐩(): 𝐑𝐞𝐦𝐨𝐯𝐞𝐬 𝐥𝐞𝐚𝐝𝐢𝐧𝐠 𝐚𝐧𝐝 𝐭𝐫𝐚𝐢𝐥𝐢𝐧𝐠 𝐰𝐡𝐢𝐭𝐞𝐬𝐩𝐚𝐜𝐞 𝐟𝐫𝐨𝐦 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = " Hello "
stripped_string = my_string.strip() # stripped_string will be "Hello"
𝟓- 𝐬𝐩𝐥𝐢𝐭(): 𝐒𝐩𝐥𝐢𝐭𝐬 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐢𝐧𝐭𝐨 𝐚 𝐥𝐢𝐬𝐭 𝐨𝐟 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐚 𝐝𝐞𝐥𝐢𝐦𝐢𝐭𝐞𝐫.
my_string = "apple,banana,orange"
fruits = my_string.split(",") # fruits will be ["apple", "banana", "orange"]
𝟔- 𝐣𝐨𝐢𝐧(): 𝐉𝐨𝐢𝐧𝐬 𝐭𝐡𝐞 𝐞𝐥𝐞𝐦𝐞𝐧𝐭𝐬 𝐨𝐟 𝐚 𝐥𝐢𝐬𝐭 𝐢𝐧𝐭𝐨 𝐚 𝐬𝐢𝐧𝐠𝐥𝐞 𝐬𝐭𝐫𝐢𝐧𝐠 𝐮𝐬𝐢𝐧𝐠 𝐚 𝐬𝐩𝐞𝐜𝐢𝐟𝐢𝐞𝐝 𝐬𝐞𝐩𝐚𝐫𝐚𝐭𝐨𝐫.
fruits = ["apple", "banana", "orange"]
my_string = ",".join(fruits) # my_string will be "apple,banana,orange"
𝟕- 𝐟𝐢𝐧𝐝() 𝐚𝐧𝐝 𝐢𝐧𝐝𝐞𝐱(): 𝐒𝐞𝐚𝐫𝐜𝐡 𝐟𝐨𝐫 𝐚 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠 𝐰𝐢𝐭𝐡𝐢𝐧 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐚𝐧𝐝 𝐫𝐞𝐭𝐮𝐫𝐧 𝐢𝐭𝐬 𝐢𝐧𝐝𝐞𝐱.
my_string = "Hello, world!"
index1 = my_string.find("world") # index1 will be 7
index2 = my_string.index("world") # index2 will also be 7
𝟖- 𝐫𝐞𝐩𝐥𝐚𝐜𝐞(): 𝐑𝐞𝐩𝐥𝐚𝐜𝐞𝐬 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐧𝐜𝐞𝐬 𝐨𝐟 𝐚 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠 𝐰𝐢𝐭𝐡 𝐚𝐧𝐨𝐭𝐡𝐞𝐫 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "Hello, world!"
new_string = my_string.replace("world", "Python") # new_string will be "Hello, Python!"
𝟗- 𝐬𝐭𝐚𝐫𝐭𝐬𝐰𝐢𝐭𝐡() 𝐚𝐧𝐝 𝐞𝐧𝐝𝐬𝐰𝐢𝐭𝐡(): 𝐂𝐡𝐞𝐜𝐤𝐬 𝐢𝐟 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐬𝐭𝐚𝐫𝐭𝐬 𝐨𝐫 𝐞𝐧𝐝𝐬 𝐰𝐢𝐭𝐡 𝐚 𝐬𝐩𝐞𝐜𝐢𝐟𝐢𝐞𝐝 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "Hello, world!"
starts_with_hello = my_string.startswith("Hello") # True
ends_with_world = my_string.endswith("world") # False
𝟏𝟎- 𝐜𝐨𝐮𝐧𝐭(): 𝐂𝐨𝐮𝐧𝐭𝐬 𝐭𝐡𝐞 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐧𝐜𝐞𝐬 𝐨𝐟 𝐚 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠 𝐢𝐧 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "apple, banana, orange, banana"
count = my_string.count("banana") # count will be 2
Python Free Resources
👇👇
https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
Hope you'll like it
Like this post if you need more resources like this 👍❤️
Strings in Python are immutable sequences of characters.
𝟏- 𝐥𝐞𝐧(): 𝐑𝐞𝐭𝐮𝐫𝐧𝐬 𝐭𝐡𝐞 𝐥𝐞𝐧𝐠𝐭𝐡 𝐨𝐟 𝐭𝐡𝐞 𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "Hello"
length = len(my_string) # length will be 5
𝟐- 𝐬𝐭𝐫(): 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐬 𝐧𝐨𝐧-𝐬𝐭𝐫𝐢𝐧𝐠 𝐝𝐚𝐭𝐚 𝐭𝐲𝐩𝐞𝐬 𝐢𝐧𝐭𝐨 𝐬𝐭𝐫𝐢𝐧𝐠𝐬.
num = 123
str_num = str(num) # str_num will be "123"
𝟑- 𝐥𝐨𝐰𝐞𝐫() 𝐚𝐧𝐝 𝐮𝐩𝐩𝐞𝐫(): 𝐂𝐨𝐧𝐯𝐞𝐫𝐭 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐭𝐨 𝐥𝐨𝐰𝐞𝐫𝐜𝐚𝐬𝐞 𝐨𝐫 𝐮𝐩𝐩𝐞𝐫𝐜𝐚𝐬𝐞.
my_string = "Hello"
lower_case = my_string.lower() # lower_case will be "hello"
upper_case = my_string.upper() # upper_case will be "HELLO"
𝟒- 𝐬𝐭𝐫𝐢𝐩(): 𝐑𝐞𝐦𝐨𝐯𝐞𝐬 𝐥𝐞𝐚𝐝𝐢𝐧𝐠 𝐚𝐧𝐝 𝐭𝐫𝐚𝐢𝐥𝐢𝐧𝐠 𝐰𝐡𝐢𝐭𝐞𝐬𝐩𝐚𝐜𝐞 𝐟𝐫𝐨𝐦 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = " Hello "
stripped_string = my_string.strip() # stripped_string will be "Hello"
𝟓- 𝐬𝐩𝐥𝐢𝐭(): 𝐒𝐩𝐥𝐢𝐭𝐬 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐢𝐧𝐭𝐨 𝐚 𝐥𝐢𝐬𝐭 𝐨𝐟 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠𝐬 𝐛𝐚𝐬𝐞𝐝 𝐨𝐧 𝐚 𝐝𝐞𝐥𝐢𝐦𝐢𝐭𝐞𝐫.
my_string = "apple,banana,orange"
fruits = my_string.split(",") # fruits will be ["apple", "banana", "orange"]
𝟔- 𝐣𝐨𝐢𝐧(): 𝐉𝐨𝐢𝐧𝐬 𝐭𝐡𝐞 𝐞𝐥𝐞𝐦𝐞𝐧𝐭𝐬 𝐨𝐟 𝐚 𝐥𝐢𝐬𝐭 𝐢𝐧𝐭𝐨 𝐚 𝐬𝐢𝐧𝐠𝐥𝐞 𝐬𝐭𝐫𝐢𝐧𝐠 𝐮𝐬𝐢𝐧𝐠 𝐚 𝐬𝐩𝐞𝐜𝐢𝐟𝐢𝐞𝐝 𝐬𝐞𝐩𝐚𝐫𝐚𝐭𝐨𝐫.
fruits = ["apple", "banana", "orange"]
my_string = ",".join(fruits) # my_string will be "apple,banana,orange"
𝟕- 𝐟𝐢𝐧𝐝() 𝐚𝐧𝐝 𝐢𝐧𝐝𝐞𝐱(): 𝐒𝐞𝐚𝐫𝐜𝐡 𝐟𝐨𝐫 𝐚 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠 𝐰𝐢𝐭𝐡𝐢𝐧 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐚𝐧𝐝 𝐫𝐞𝐭𝐮𝐫𝐧 𝐢𝐭𝐬 𝐢𝐧𝐝𝐞𝐱.
my_string = "Hello, world!"
index1 = my_string.find("world") # index1 will be 7
index2 = my_string.index("world") # index2 will also be 7
𝟖- 𝐫𝐞𝐩𝐥𝐚𝐜𝐞(): 𝐑𝐞𝐩𝐥𝐚𝐜𝐞𝐬 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐧𝐜𝐞𝐬 𝐨𝐟 𝐚 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠 𝐰𝐢𝐭𝐡 𝐚𝐧𝐨𝐭𝐡𝐞𝐫 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "Hello, world!"
new_string = my_string.replace("world", "Python") # new_string will be "Hello, Python!"
𝟗- 𝐬𝐭𝐚𝐫𝐭𝐬𝐰𝐢𝐭𝐡() 𝐚𝐧𝐝 𝐞𝐧𝐝𝐬𝐰𝐢𝐭𝐡(): 𝐂𝐡𝐞𝐜𝐤𝐬 𝐢𝐟 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠 𝐬𝐭𝐚𝐫𝐭𝐬 𝐨𝐫 𝐞𝐧𝐝𝐬 𝐰𝐢𝐭𝐡 𝐚 𝐬𝐩𝐞𝐜𝐢𝐟𝐢𝐞𝐝 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "Hello, world!"
starts_with_hello = my_string.startswith("Hello") # True
ends_with_world = my_string.endswith("world") # False
𝟏𝟎- 𝐜𝐨𝐮𝐧𝐭(): 𝐂𝐨𝐮𝐧𝐭𝐬 𝐭𝐡𝐞 𝐨𝐜𝐜𝐮𝐫𝐫𝐞𝐧𝐜𝐞𝐬 𝐨𝐟 𝐚 𝐬𝐮𝐛𝐬𝐭𝐫𝐢𝐧𝐠 𝐢𝐧 𝐚 𝐬𝐭𝐫𝐢𝐧𝐠.
my_string = "apple, banana, orange, banana"
count = my_string.count("banana") # count will be 2
Python Free Resources
👇👇
https://whatsapp.com/channel/0029VaiM08SDuMRaGKd9Wv0L
Hope you'll like it
Like this post if you need more resources like this 👍❤️
👍4❤1