to_the_moon.py

Time to play with IO so to the moon we go! Code is downloadable en bloc on the left, or you can copy and paste this displayed code. Problem 0 is an example. Look at §4 p0.pdf.


################### problem 0 ########################
#  print out x*y = (result)  using f-strings.
x = 5
y = 12
print(f"{x}*{y} = {x*y}")
################### problem 1 ########################
#Obtain values for x and y from the user.  Then print out
#  x*x + y*y = (result)

################### problem 2 ########################
#edit this line of code as succinctly as possible
print("cats", "dawgs", "elliefants", "ferengi")
#to get this exact output
#cats * dawgs * elliefants * ferengi
################### problem 3 ########################
#edit this line of code as succinctly as possible
print("cats")
print("dawgs")
print("elliefants")
print("ferengi")
#to get this output
#cats|dawgs|ellifants|ferengi
################### problem 4 ########################
#ask the user for his name and age. Then print this out
#(name), you are (age) years old.
################### problem 5 ########################
#Use five print statements to create this "tree"
#*
#**
#***
#****
#*****
#******
################### problem 6 ########################
#Create the tree in problem 5 using * and \n in a single
#print statement.
################### problem 7 ########################
#create the tree using a triple-quoted string
################### problem 8 ########################
#Learn about raw strings. Use a raw string to print this
#with no double-backslashing
#C:\Windoze\Inferior_OS\Bill_Gates\pfooie.py