SlideShare a Scribd company logo
3 pages
Part 1:
Python comes with a program called an IDLE, which belongs to
a type of software known in computer science as an IDE
(Integrated Development Environment). IDE's make
programming easier, because they color the code for you, give
you quick access to built in functions, debug your code, and
allow you to run your code from the IDE instead of using the
command line.
We will use IDLE in this course, but you are welcome to use
ANY IDE you like! Or if you simply like to go old school and
type your programs in a text editor (like Notepad) and run it
manually through the command prompt, that is fine also! :)
Follow these steps to write your 1st Python program with IDLE:
1- Start IDLE, and select New File from the File menu
2- Type: print ("Hello world")
3- Save the file, by going to the File menu, make sure to save
the file as with a .py extension. So you can call it hello.py or
bifs617_wk2.py
4- Run the program by going to the Run menu and select Run
Module
5- Congratulations! You've written and run your 1st Python
program ;)
Questions:
1- What is
print
in your program actually doing? And why is "Hello world"
between double quotes?
2- Add your name and the date to the code above, as comment
lines (see Chapter 2 of text book on how to do this)
3- Take a snap shot of your code and paste it (or attach it) to
your response. Also mention any issues you might have had.
Part 2: One of the key elements of designing a good program is
to allow the user(s) to interact with it. You can do so by asking
the user to input a file name, a string representing a DNA
sequence, or just a number. These input that are coming in from
the user get stored in variables, and make your program more
interactive. They also allow you to write a general program that
can work for any input (the user (or you) can run your program
100 times and each time input a different DNA sequence for
instance).
The Python function to ask for use input, is simply called
input()
Here is an example of how it can be used:
DNA = input("Enter a DNA sequence")
When you run this, you will see the string "Enter a DNA
sequence", followed by a blinking line. That means Python is
waiting for you to type in something! Once you type in a bunch
of characters and hit enter, Python will grab what you typed and
assign it to the variable DNA. So the string the user typed is
now stored in memory and can be accessed by using the name
DNA.
Here is an exercise:
Ask a user for 5 number. Use the input function, and store each
number in a variable. Then calculate the sum and average of the
numbers. Print out both the sum and average to the screen.
Post your code and the results of your calculation here (snap
shot would be fine). In the conferences you are encouraged to
help one another to solve the exercises (not so for the
assignments which are individual tasks!).

More Related Content

PPT
Introduction to Python Lesson One-Python Easy Learning
PDF
Python for Physical Science.pdf
PDF
Notes1
PDF
Learning Python for Raspberry Pi
PPTX
Chapter 1-Introduction and syntax of python programming.pptx
PPTX
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
DOCX
Course set three full notes
DOCX
python isn't just a snake
Introduction to Python Lesson One-Python Easy Learning
Python for Physical Science.pdf
Notes1
Learning Python for Raspberry Pi
Chapter 1-Introduction and syntax of python programming.pptx
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Course set three full notes
python isn't just a snake

Similar to 3 pagesPart 1Python comes with a program called an IDLE, wh.docx (20)

ODP
An Intro to Python in 30 minutes
PPTX
Introduction to Python Basics for PSSE Integration
PPTX
PYTHON PROGRAMMING.pptx
PDF
Lecture 0 - CS50's Introduction to Programming with Python.pdf
PDF
introduction to python programming course
PDF
pyton Notes1
PPTX
Python basics
PPTX
Python_Introduction&DataType.pptx
PPTX
Programming python quick intro for schools
DOCX
A Introduction Book of python For Beginners.docx
PPTX
Python programming workshop session 1
PPTX
Baabtra.com little coder chapter - 2
PPT
Python week 1 2020-2021
ODP
Introduction to Python - Training for Kids
PPTX
Python (Data Analysis) cleaning and visualize
PPTX
#Code2Create: Python Basics
PDF
python.pdf
PPTX
Learn Python The Hard Way Presentation
PPT
Python Programming Language
An Intro to Python in 30 minutes
Introduction to Python Basics for PSSE Integration
PYTHON PROGRAMMING.pptx
Lecture 0 - CS50's Introduction to Programming with Python.pdf
introduction to python programming course
pyton Notes1
Python basics
Python_Introduction&DataType.pptx
Programming python quick intro for schools
A Introduction Book of python For Beginners.docx
Python programming workshop session 1
Baabtra.com little coder chapter - 2
Python week 1 2020-2021
Introduction to Python - Training for Kids
Python (Data Analysis) cleaning and visualize
#Code2Create: Python Basics
python.pdf
Learn Python The Hard Way Presentation
Python Programming Language
Ad

More from domenicacullison (20)

DOCX
5 to 8  sentence each 1. Declining marriage rates have led many .docx
DOCX
5-7 PagesYou will craft individual essays in response to the pro.docx
DOCX
5.1 Assignment Reading and RemediationGetting Start.docx
DOCX
4TH EDITIONManaging and UsingInformation Systems.docx
DOCX
5. The Holy Trinity is central to Catholic beliefs about God. We acc.docx
DOCX
5.1 Provide a brief definition of network access control.5.2 W.docx
DOCX
4Discussion 6 Review of Four Indiana State Policies.docx
DOCX
492020 Print Previewhttpsng.cengage.comstaticnbui.docx
DOCX
4pagesone is assginmentthe other 3 essays are related wo.docx
DOCX
47PATIENT FILEThe Case The sleepy woman with anxiety.docx
DOCX
4To Replace with name Comment by Sharon Rose Use down ar.docx
DOCX
5 pages in length (not including title page or references)This.docx
DOCX
5 to 7 DAY EXERCISE LOG Exercise Log Name___Hejin Lin__.docx
DOCX
5 Pages 1. Should nonprofit organizations be viewed principally .docx
DOCX
5 pagesResearch either a wildfire and mass movement (one tha.docx
DOCX
5 Establishing Organizational ObjectivesiStockThinkstock.docx
DOCX
465 Current Procedural Terminology © 2015 American Medical A.docx
DOCX
450+ WordsDiscussion Questions What are the main tenants of.docx
DOCX
459- Provide a substantive response to at least two of your pe.docx
DOCX
4th Grade Science-A Discussion of how Students Learn to Self Assess.docx
5 to 8  sentence each 1. Declining marriage rates have led many .docx
5-7 PagesYou will craft individual essays in response to the pro.docx
5.1 Assignment Reading and RemediationGetting Start.docx
4TH EDITIONManaging and UsingInformation Systems.docx
5. The Holy Trinity is central to Catholic beliefs about God. We acc.docx
5.1 Provide a brief definition of network access control.5.2 W.docx
4Discussion 6 Review of Four Indiana State Policies.docx
492020 Print Previewhttpsng.cengage.comstaticnbui.docx
4pagesone is assginmentthe other 3 essays are related wo.docx
47PATIENT FILEThe Case The sleepy woman with anxiety.docx
4To Replace with name Comment by Sharon Rose Use down ar.docx
5 pages in length (not including title page or references)This.docx
5 to 7 DAY EXERCISE LOG Exercise Log Name___Hejin Lin__.docx
5 Pages 1. Should nonprofit organizations be viewed principally .docx
5 pagesResearch either a wildfire and mass movement (one tha.docx
5 Establishing Organizational ObjectivesiStockThinkstock.docx
465 Current Procedural Terminology © 2015 American Medical A.docx
450+ WordsDiscussion Questions What are the main tenants of.docx
459- Provide a substantive response to at least two of your pe.docx
4th Grade Science-A Discussion of how Students Learn to Self Assess.docx
Ad

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
RMMM.pdf make it easy to upload and study
PPTX
Cell Types and Its function , kingdom of life
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
VCE English Exam - Section C Student Revision Booklet
Microbial disease of the cardiovascular and lymphatic systems
PPH.pptx obstetrics and gynecology in nursing
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
RMMM.pdf make it easy to upload and study
Cell Types and Its function , kingdom of life
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
TR - Agricultural Crops Production NC III.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Supply Chain Operations Speaking Notes -ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
human mycosis Human fungal infections are called human mycosis..pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
O7-L3 Supply Chain Operations - ICLT Program
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
VCE English Exam - Section C Student Revision Booklet

3 pagesPart 1Python comes with a program called an IDLE, wh.docx

  • 1. 3 pages Part 1: Python comes with a program called an IDLE, which belongs to a type of software known in computer science as an IDE (Integrated Development Environment). IDE's make programming easier, because they color the code for you, give you quick access to built in functions, debug your code, and allow you to run your code from the IDE instead of using the command line. We will use IDLE in this course, but you are welcome to use ANY IDE you like! Or if you simply like to go old school and type your programs in a text editor (like Notepad) and run it manually through the command prompt, that is fine also! :) Follow these steps to write your 1st Python program with IDLE: 1- Start IDLE, and select New File from the File menu 2- Type: print ("Hello world") 3- Save the file, by going to the File menu, make sure to save the file as with a .py extension. So you can call it hello.py or bifs617_wk2.py 4- Run the program by going to the Run menu and select Run Module 5- Congratulations! You've written and run your 1st Python program ;) Questions:
  • 2. 1- What is print in your program actually doing? And why is "Hello world" between double quotes? 2- Add your name and the date to the code above, as comment lines (see Chapter 2 of text book on how to do this) 3- Take a snap shot of your code and paste it (or attach it) to your response. Also mention any issues you might have had. Part 2: One of the key elements of designing a good program is to allow the user(s) to interact with it. You can do so by asking the user to input a file name, a string representing a DNA sequence, or just a number. These input that are coming in from the user get stored in variables, and make your program more interactive. They also allow you to write a general program that can work for any input (the user (or you) can run your program 100 times and each time input a different DNA sequence for instance). The Python function to ask for use input, is simply called input() Here is an example of how it can be used: DNA = input("Enter a DNA sequence") When you run this, you will see the string "Enter a DNA sequence", followed by a blinking line. That means Python is waiting for you to type in something! Once you type in a bunch of characters and hit enter, Python will grab what you typed and assign it to the variable DNA. So the string the user typed is now stored in memory and can be accessed by using the name DNA.
  • 3. Here is an exercise: Ask a user for 5 number. Use the input function, and store each number in a variable. Then calculate the sum and average of the numbers. Print out both the sum and average to the screen. Post your code and the results of your calculation here (snap shot would be fine). In the conferences you are encouraged to help one another to solve the exercises (not so for the assignments which are individual tasks!).