Giter Club home page Giter Club logo

python1ex's Introduction

Part 1

Accompanying resources

Exercise 1

  • Open Terminal.
  • Launch the Python interpreter.
  • Print a line that says "Hello Python".
  • Exit the Python interpreter.

Exercise 2

  • Using the Python interpreter, identify the data type for the following values:
    • True
    • 42
    • False
    • 1.5
    • "Python is fun"
    • "3.5"

Exercise 3

  • Using the Python interpreter, perform the following operations. Be sure to experiment with mixing intergers and floats.
    • Addition
    • Subtraction
    • Multiplication
    • Division
    • Floor division
    • Modulo
    • Exponentiation

Exercise 4

Create a Python script called first_name_500_times.py. Modify your script according to the instructions below.

  • Declare a variable called first_name with your first name as its value.
  • Print the value of first_name to the screen 500 times.
  • Save & execute the script.

Exercise 5.a

  • Using Terminal, make a copy of first_name_500_times.py and call it full_name.py
cp first_name_500_times.py full_name.py

Exercise 5.b

Modify full_name.py according to the instructions below.

  • Comment out the line where your first name was printed 500 times.
  • Create a variable called last_name with your last name as its value.
  • Create a variable called full_name whose value is the combination of the first_name variable and the last_name variable.
  • Print the value of the full_name variable.

Exercise 6

Create a Python script called fahrenheit_to_celsius.py

  • The script should declare a variable called fahrenheit.
  • The script should then convert the value of fahrenheit to celsius.
  • The conversion should be displayed on the screeen in the following format: "32 degrees fahrenheit is equal to 0.0 degree(s) celsius"

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.