Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
PyGen2
#python 3.6.9 #PyGen2: example of Python generator expression #this code is created by Rezaul Hoque on April 26,2022. #contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com #note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; def start(): print("Python generator expression example") yield '#'*25 print("April 26,2022") yield '*'*25 ### #def cel2far(ar): # for k in ar: # yield 9*k/5+32 #def cel2kel(ar): # for k in ar: # yield k+273.15 ####### temp=[10,20,15,35,40] cel2far=(9*k/5+32 for k in temp) cel2kel=(k+273.15 for k in temp) #theList=cel2far(temp) #theList2=cel2kel(temp) m=start() display=next(m) print(display) display=next(m) print(display) print("Temperature in Celsius: ") for s in temp: print(s) print("Temperature in Fahrenheit:") for s in cel2far: print(s) print("Temperature in Kelvin: ") for s in cel2kel: print(s)
run
|
edit
|
history
|
help
0
binary_search_in_python
Your mom
solving a linear system of equations
Exercise 4 for lesson 2
(P3) Starsza data
fibonacciseries
selenium -proj
Юра и заселение
arjun chinese class
PyQueue