test
This commit is contained in:
1 parent
88624bc20a
commit
81d46a7d32
24 files changed
+1335
No files matched your search
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
#this tells linux and mac operating systems that this file is a python file. Windows may use it as a hint as well
|
||||
#everything after a pound sign is a comment
|
||||
|
||||
"""
|
||||
Comments can go between triple quotation marks
|
||||
"""
|
||||
|
||||
import math #imports the builtin math library
|
||||
|
||||
print("Hello world") #a builtin functio nto write to the terminal
|
||||
|
||||
print("The value of pi is " + str(math.pi))
|
||||
#this is doing a few things
|
||||
# "The value of pi is " - this is a string literal
|
||||
# "The value of pi is " + (something else) - we are concatenating something else to this string
|
||||
# math.pi - this is a floating point constant in the math library
|
||||
# (it's cast to a string and the resulting concatenated string is something like "The value of pi is 3.141592653589793")
|
||||
# print(the string) - prints that to the terminal
|
||||
|
||||
print("The value of pi is", math.pi) #another way to do it
|
||||
Reference in new issue
Block a user