Epython Lab
6.76K subscribers
633 photos
30 videos
103 files
1.16K 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
#CODE_CHALLENGE #PYTHON_LIST #LOOPS #FUNCTIONS

1. Write a function called delete_starting_evens() that has a parameter named lst.

The function should remove elements from the front of lst until the front of the list is not even. The function should then return lst.

For example if lst started as [4, 8, 10, 11, 12, 15], then delete_starting_evens(lst) should return [11, 12, 15].

Make sure your function works even if every element in the list is even!

POST YOUR SOLUTION @Pydiscussion
#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_3 #LIST #SWAP_TWO_NUMBERS


#Q: The next iteration of Asibeh Tenager will feature an extra-infuriating new item, the Purple Shell. When used, it warps the last place racer into first place and the first place racer into last place. Write a python function purple_shell and implement the Purple Shell's effect.

Note: Given a list of racers, set the first place racer (at the front of the list) to last
place and vice versa.
N.B: use swap mechanism

given list: racers = ["Asibeh", "Naol", "Obang"]
output list = ["Obang", "Naol", "Asibeh"]
Post
your solution at @pythonethbot
Epython Lab
#CODE_CHALLENGE_3 #LIST #SWAP_TWO_NUMBERS #Q: The next iteration of Asibeh Tenager will feature an extra-infuriating new item, the Purple Shell. When used, it warps the last place racer into first place and the first place racer into last place. Write a…
#Solution for #CODE_CHALLENGE_3

# Given a list of racers, set the first place racer (at the front of the list)
# Use swap mechanism
def purple_shell(lst):
# swap list items
temp = lst[0]
lst[0] = lst[2]
lst[2] = temp

return lst

#
code driver
racers = ['Asibeh', 'Naol', 'Obang']

purple_shell(racers)

#Output: ['Obang', 'Naol', 'Asibeh']
1.pdf
3.5 MB
ML Algorithms Cheatsheet (python and R)
#code #python #R
@epythonlab #mlbooks
#Code_Challenge #python #function #loop
Write a function that will return the sum of the first item in the data list and every tenth item after?
Forwarded from Epython Lab (Asibeh Tenager)
#CODE_CHALLENGE #PYTHON_LIST #LOOPS #FUNCTIONS

1. Write a function called delete_starting_evens() that has a parameter named lst.

The function should remove elements from the front of lst until the front of the list is not even. The function should then return lst.

For example if lst started as [4, 8, 10, 11, 12, 15], then delete_starting_evens(lst) should return [11, 12, 15].

Make sure your function works even if every element in the list is even!

POST YOUR SOLUTION @PYTHONETHBOT
🔝 Write an SQL query builder in 150 lines of Python!

https://death.andgravity.com/query-builder-how

Join @epythonlab for information #sql #article #python #code
Scraping is one way of obtaining data from web page. Here you can learn Web scraping with some python libraries.

Mastering Web Scraping in Python: Scaling to Distributed Crawling

https://www.zenrows.com/blog/mastering-web-scraping-in-python-scaling-to-distributed-crawling

@epythonlab #article #code #webscraping
#CODE_CHALLENGE #PYTHON_LIST #LOOPS #FUNCTIONS

1. Write a function called delete_starting_evens() that has a parameter named lst.

The function should remove elements from the front of lst until the front of the list is not even. The function should then return lst.

For example if lst started as [4, 8, 10, 11, 12, 15], then delete_starting_evens(lst) should return [11, 12, 15].

Make sure your function works even if every element in the list is even!

POST YOUR SOLUTION @Pydiscussion
#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