Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Gardener
#Python 2.7.17 #Gardener: use of tuple,slice,concatenation ,for loop in python #this code is created by Rezaul Hoque on October 19,2021;contact: jewelmrh@yahoo.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; garden = () if not garden: print "Garden is empty.\n" input("Press enter key to continue\n"); garden=( "Night Queen","Marigold","Jasmine","Rose","Daisy","China-rose"); print "Your garden has:\n", garden print "Flower trees are:\n" for i in garden: print i if "Night Queen" in garden: print "The fragrance will reign the neighborhood.\n" flow=input("Do you have Sunflower in your garden?\n") if "Sunflower" in garden: print "Yes, I have\n" else: print "No,I don't have any." print "\nSlice example:\n" print "garden[ ",0,":" ,4,"]\t\n", print garden[0:4] #nput("\nPress the enter key to continue. \n") pot = ("Sunflower", "Juhi") print "\nYou've just bought new plants." garden += pot print "\nYour garden has: \n", for i in garden: print i input("\nPress the enter key to exit.")
run
|
edit
|
history
|
help
0
fb_series
problem rstring
1.problem_name_1
PyDeco
PyLamb
NormalizeTags
16
daily score
0dd08b977895229d09b4848e467a4e10162ed345de0b245922b3505909d33ead
Nama Bulan Python