################################################################################### # # AUTHOR: Austin Horner # DATE: 2023-9-22, 2023-9-24 # LEVEL: Grade 10 # INSTRUCTOR: Mr. Jones # CLASS: Computer Science A # SCHOOL: Oregon Charter Academy # ASSIGNMENT: CSA Intro, Assignment #1 # PURPOSE: Introduction to Python. # TEST PRINT COMMANDS # Practice comments, print, variables, # Use IDE firewalledreplit.com. # Print a poem or song. # ###################### PRINT POEM BY TUPAC SHAKUR ################################### # POEM TITLE AND AUTHOR title = "The Rose That Grew From Concrete" author = "Tupac Shakur" # LINES OF THE POEM a = "Did you hear about the rose that grew" b = "from a crack in the concrete?" c = "Proving nature's law is wrong it" d = "\nlearned to walk without having feet.\n" e = "Funny it seems, but by keeping its dreams," f = "it learned to breathe fresh air." g = "Long live the rose that grew from concrete" h = "when no one else ever cared." ################### VARIATIONS OF THE PRINT COMMAND ############## # print with new lines # print("\n\n") # Intro white space # print variable # print (title) # print list of arguments # print ("by", author, "\n\n") # variable and string # comma delimited inserts a space between items # print variables added together print (a) # print (b + c) This puts 2 strings together, no white space print (b) # print two variables print(c,d) ##### FOR LOOP ############ # use for loop to print a list of arguments # poemlines = [e, f, g, h] for x in poemlines: print(x) # TO DO: Figure out how to print elements of an array with an index # incremented in the loop ###### TRIPLE QUOTE PRINT ##### # GRAND FINALE # # PRINT MULTIPLE LINES with triple quote print command # # Report end of program, helpful for debugging code with many modules print(""" PRINT COMMAND PROGRAM COMPLETE: CSA_Intro_HornerA.py """) # End triple quote multi-line print ######################## END PROGRAM CSA_Intro_HornerA.py ######################################