#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
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
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
#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']
# 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']
#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?
Write a function that will return the sum of the first item in the data list and every tenth item after?
💻 Linear Algebra for Natural Language Processing
https://www.kdnuggets.com/2021/08/linear-algebra-natural-language-processing.html
Code: https://github.com/Taaniya/linear-algebra-for-ml
@epythonlab #nlp #code #article
https://www.kdnuggets.com/2021/08/linear-algebra-natural-language-processing.html
Code: https://github.com/Taaniya/linear-algebra-for-ml
@epythonlab #nlp #code #article
What is Namespace in Python?
https://www.pythonforbeginners.com/basics/what-is-namespace-in-python
@epythonlab #code #article
https://www.pythonforbeginners.com/basics/what-is-namespace-in-python
@epythonlab #code #article
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
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
https://death.andgravity.com/query-builder-how
Join @epythonlab for information #sql #article #python #code
How to add an Element to a Set in Python
https://www.pythonforbeginners.com/basics/how-to-add-an-element-to-a-set-in-python
@epythonlab #code #article
https://www.pythonforbeginners.com/basics/how-to-add-an-element-to-a-set-in-python
@epythonlab #code #article
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
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
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
Forwarded from Epython Lab
💻 Linear Algebra for Natural Language Processing
https://www.kdnuggets.com/2021/08/linear-algebra-natural-language-processing.html
Code: https://github.com/Taaniya/linear-algebra-for-ml
@epythonlab #nlp #code #article
https://www.kdnuggets.com/2021/08/linear-algebra-natural-language-processing.html
Code: https://github.com/Taaniya/linear-algebra-for-ml
@epythonlab #nlp #code #article
#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
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