Skip to content

aidev13/monty-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Monty-Python - "Let's not bicker and argue about who coded who!"

To enter the python repel, open the terminal and type in py. To exit the python repel type in quit()

To make a comment in python, use the # symbol

# This is a comment

--- Indentations ---

Python DOES NOT ignore whitespace

--- Operators ---

  • 4/3 = 1.333...

  • 4//3 = 1, Using // in operations will round down your division no matter the decimal

  • round(4/2.3) = 2 and round(4/3) = 1, round will either round up or down depend on the answers

  • 24 % 5 = 4, this gives you back the remainder of a division quotent

  • 2 ** 4 = 16, this means to the power of, ex - 2 x 2 x 2 x 2 = 16

  • Using +=, countup = 12, countup += 1, countup = 13, using += will add 1 to the variable - likewise -= will subtract, *= multiply and /= divide...

NOTE: Using /= with give your answer a float (decimal) output. to rid this you can round() the answer

#For exmaple...

divide = 20
divide /= 4
5.0 #answer

#rid the decimal as so,
divide = 20
divide /= 4
round(divide)
5 #answer

#OR

divide = 20
divide /= 4
divide = round(divide)
divide
5 #answer

--- Concatanation ---

"Dave " + "Liebherr" = 'David Liebherr'

--- Comparision Operators ---

  • returns a boolen
12 == 11 #False
13 == 13 #True
13 != 12 #True (! means NOT, so in this case 13 IS NOT equal to 12, which is true)
13 != 13 #False
12 > 11 # True
112 > 1231 = #False
#<=, >= AS WELL
  • and
  • or
  • not

--- NOTE ---

True and False must start with an uppercase letter

is_true = True
is_false = False

About

Let's let bicker and argue about who coded who!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages