Here it is the babylonian method
program: https:/
Here it is the babylonian method
program: https:/
An example of this can be found on my WSQ06, here’s the part of the code where i imported a module:
import random #i imported the module random that in this case it produces a random intenger from a certain parameter
value= random.randint(1,100) #What this line does is that the variable value will become a random integer (random.randint) from 1 to 100 (1,100)
print(value)
This program will show a random value from 1 to 100.
—
Another example is:
import math #this import the module math which has lots of functions that can be found here https:/
pi=math.pi #pi will take math.pi’s value which is equivalent to 3.1416…
print (pi)
This program will show:
3.141592653589793
Comments Off on #mastery13 Importing and using Python modules
Posted in Blogs, Syndicated, TC1014 Blogs
1 min read
Thanks to this WSQ i learned to apply an if function in python, i used this link to know the boiling point of water 🙂 http:/
This link also helped me to know better about the if function and other stuff in python. http:/
Here’s my code.
f=int(input(“Give me the temperature in Farenheit that you want to convert to Celsius: “))
c= 5*(f-32)/9
print(“The temperature in Celsius is: “, int(c)) ###i put the c in a parenthesis using an int so it gives the value without decimals
if c>=100:
print (“Water boils at this temperature”) ###note that you have to ident this line in order for this to work
else:
print (“Water does not boil at this temperature”) ###note that u have to ident this line in order for this to work
Comments Off on #TC1014 #WSQ05 Temperature
Posted in Blogs, Syndicated, TC1014 Blogs