Positive vibes for the reader💫💜| Interests include Web development, Linux, Data science, ML and Python | Electrical Engineer
1 subscribed
Aug 17, 2021 7 tweets 2 min read
Hi Reader, I hope you are having a good day and will have a great life from now on.

Day 8 of #100DaysOfCode.

Python
Type 2 of itertools
remember you have to import them using
from itertools import name_of_itertool 1)takewhile
Take values from iterable while the predicate function remains true,once predicate function returns false it will no
longer take values.
example:
lis=[2,4,1,8,6,14]
lis_even=list(takewhile(lambda x:x % 2 == 0,lis))
returns lis_even=[2,4]
Aug 16, 2021 8 tweets 4 min read
Hi Reader, I hope you are having a good day and will have a great life from now on.

Day 7 of #100DaysOfCode.

Python 1)Recursive Functions:
Every recursive function has a base case that stops it from going into the fourth dimension(that's what I like to think 😅).
Example 1:
Aug 12, 2021 7 tweets 2 min read
Hey Reader, I hope you are having a good day and will have a great life from now on.

Realized that I messed up the thread for day 4 so gonna tweet that again.
👇 Day 4 of #100DaysOfCode

1) List Comprehension:
is a useful way to create lists when elements obey simple rule.
e.g cubes = [i**3 for i in range(10)]
With conditional
cubes = [i**3 for i in range(10) if i%2==0]
Aug 9, 2021 15 tweets 5 min read
Day 3 of #100DaysOfCode
Python.
Motivation, Don't Repeat Yourself.

1)Defining a function
def function_name(parameters_if_any):
"""indentation identifies the code block of a function"""
return data_if_any Parameters: are variables in function definition.
Arguments: are the values put into parameters when functions are called.
Calling a function: function_name(arguments_if_any)