Giter VIP home page Giter VIP logo

codecademyq1's Introduction

Codecademy Python


Python
print "Welcome to Python!"
# Write your code below!

my_variable = 10

# Write your code above!

print my_variable
# Set the variables to the values listed in the instructions!

my_int = 7

my_float = 1.23

my_bool = True

# Write your code above!

print my_int
print my_float
print my_bool
# my_int is set to 7 below. What do you think
# will happen if we reset it to 3 and print the result?

my_int = 7

# Change the value of my_int to 3 on line 8!

my_int = 3

# Here's some code that will print my_int to the console:
# The print keyword will be covered in detail soon!

print my_int
def spam():
  eggs = 12
  return eggs
        
print spam()
spam = True

eggs = False
# What is the value of the mysterious_variable?

mysterious_variable = 42
"""Sipping from your cup 'til it runneth over,
Holy Grail.
"""
# Set count_to equal to the sum of two big numbers

count_to = 99 + 999

# Write code above!

print count_to
# Set eggs equal to 100 using exponentiation on line 3!

eggs = 10 ** 2

# Write your code above!

print eggs
#Set spam equal to 1 using modulo on line 3!

spam = 7 % 2

# Write your code above!

print spam
# Sonny Li

monty = True

python = 1.234

monty_python = python ** 2
  • Variables, which store values for later use
  • Data types, such as numbers and booleans
  • Whitespace, which separates statements
  • Comments, which make your code easier to read
  • Arithmetic operations, including +, -, *, /, **, and %

Tip Calculator

# Assign the variable total on line 8!

meal = 44.50
tax = 6.75 / 100
tip = 15.0 / 100

meal = meal + meal * tax
total = meal + meal * tip

print("%.2f" % total)

codecademyq1's People

Contributors

sonnynomnom avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.