User:Guy vandegrift/S/1

From Wikiversity
Jump to navigation Jump to search


import random, math
from math import log10 
#Hashtag denotes a comment in python.
#Hit F5 key for quick "Run"
#In python indentation must be correct.
    #It is customary to indent by one tab.
#print('Five',5)


x=100
print('x',x)
print('log(x)',log10(x))
print('trythis',10^3)#This will fail; I have no idea what 10^3 means.
#To find how to do 10 cubed google: python operators times, exponent
#First excercise: Comment out the import of log10 and show that
#you need to use math.log10 instead,
#For more about the math method, google: math method python 3