Epython Lab
6.44K subscribers
661 photos
31 videos
104 files
1.22K links
Welcome to Epython Lab, where you can get resources to learn, one-on-one trainings on machine learning, business analytics, and Python, and solutions for business problems.

Buy ads: https://telega.io/c/epythonlab
Download Telegram
#Python #DataScience #String

There are two functions that let you determine the positions of (the first occurrence of) a substring inside a string.

Example:- text = "Data Science"

Can you determine the position of "Sci" using both of the functions?

Post your solution @pythonEthBot

#COVID-19 is our challenge
Epython Lab
#Python #DataScience #String There are two functions that let you determine the positions of (the first occurrence of) a substring inside a string. Example:- text = "Data Science" Can you determine the position of "Sci" using both of the functions? …
#Solution
1. Using index() function we can determine the position of the first character of the substring in the string example: text.index("Sci") is 5.
2. The same thing we can use find() function
Example: text.find("Sci") is 5.

Note: the difference between these functions in how they deal with the situation when the substring is not contained in the string. For the index() function an error is generated but instead the find() function returns -1.
Example: text.find("s") # -1
text.index("s) # return error
Because small "s" is not found in the string "Data Science"

#DataScience #String #Python

#Prevent #COVID19
#Q1

#DataScience #Python #String

You can split up your string into separate substrings according to the presence of whitespace. This creates a list of strings, where a 'list' is simply a container for the strings. Lists are Python objects in thier own right and we will discuss further in the next time.

In the other way we can also combine a list of strings and create a single long text.

Q: what functions we use to separate and combine strings? Explain using examples.

Post your solution @pythonEthBot

#PreventCOVID19
#CODE_CHALLENGE_2 #FUNCTION #LIST_SLIC #STRING

1. Commercial bank of Ethiopia realized that their policy of using the first five letters of an employee’s last name as a user name isn’t ideal when they have multiple employees with the same last name.

Write a function called account_generator that takes two inputs, first_name and last_name and concatenates the first three letters of each and then returns the new account name.

2. They also wants to update how they generate temporary passwords for new employees.

Write a function called password_generator that takes two inputs, first_name and last_name and then concatenate the last three letters of each and returns them as a string.

Example: first_name = "Asibeh"
last_name = "Tenager"

expected output: user_name = AsiTen
temp_password = behger

Post your solution @PYTHONETHBOT
#CODE_CHALLENGE_2 #FUNCTION #LIST_SLIC #STRING

1. Commercial bank of Ethiopia realized that their policy of using the first five letters of an employee’s last name as a user name isn’t ideal when they have multiple employees with the same last name.

Write a function called account_generator that takes two inputs, first_name and last_name and concatenates the first three letters of each and then returns the new account name.

2. They also wants to update how they generate temporary passwords for new employees.

Write a function called password_generator that takes two inputs, first_name and last_name and then concatenate the last three letters of each and returns them as a string.

Example: first_name = "Asibeh"
last_name = "Tenager"

expected output: user_name = AsiTen
temp_password = behger

Post your solution in the comment box
@epythonlab
👍8
🤔 Think of yourself as a Data Scientist and given data to you to clean it. The data might contains unnecessary characters(i.e #*()/?@&$%\;[]{}) and you're required to remove those special characters from your data.

Therefore, in this tutorial, you will be learning about how to remove special characters or punctuations from any data using three different methods.

👉https://youtu.be/CVSMl3RKERk

🙏 Don't forget to subscribe, like, and share
👍4
🤔 Think of yourself as a Data Scientist and given data to you to clean it. The data might contains unnecessary characters(i.e #*()/?@&$%\;[]{}) and you're required to remove those special characters from your data.

Therefore, in this tutorial, you will be learning about how to remove special characters or punctuations from any data using three different methods.

👉https://youtu.be/CVSMl3RKERk

🙏 Don't forget to subscribe, like, and share
🔥3