Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Slides:

NotificationsYou must be signed in to change notification settings

ZipCodeCore/PythonFundamentals.Exercises.Part1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

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 calledfirst_name_500_times.py. Modify your script according to the instructions below.

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

Exercise 5.a

  • Using Terminal, make a copy offirst_name_500_times.py and call itfull_name.py
cp first_name_500_times.py full_name.py

Exercise 5.b

Modifyfull_name.py according to the instructions below.

  • Comment out the line where your first name was printed 500 times.
  • Create a variable calledlast_name with your last name as its value.
  • Create a variable calledfull_name whose value is the combination of thefirst_name variable and thelast_name variable.
  • Print the value of thefull_name variable.

Exercise 6

Create a Python script calledfahrenheit_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"

About

Slides:

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp