Peal Hussein Nyenkan
Tuesday, June 18, 2013
Python June 18, 2013
Hello Readers,
# Exercise 0 : List Access
"""
Please add the code to print out the second element in the list.
"""
n = [1, 3, 5
Thursday, June 13, 2013
Thursday Lesson
Today, we learn about groceries listing in our python programming class
click this more lesson
www.dropbox.com/s/r8f1hms97nw5mc2/Lesson6-GroceryShopper.py
Thursday, June 6, 2013
My first day in the Intermediate Python Programing
"""
Learning Python
Lesson 6 : List & Dictionaries
Dictionaries
Simple programming exercises from Codecademy
"""
# Exercise 0 : This Next Part is Key
"""
Wednesday, May 29, 2013
Day 7
Dear Friends!
Below are my day 7 lesson. for Detail Info: https://www.dropbox.com/s/vq7ecyj4jyb7udn/L5-Functions.pptx
Below are my day 7 lesson. for Detail Info: https://www.dropbox.com/s/vq7ecyj4jyb7udn/L5-Functions.pptx
Monday, May 27, 2013
Day 6
Dear Friends!
It was so difficult for me today after a two day missed in class from Grand Bassa county for a family problem. But, however, I manage to get around the lesson.
Today, we dealt with the topic called functions. Here are the practice works and its
link: www. dropbox.com/s/vq7ecyj4jyb7udn/L5-Functions.pptx
"""
It was so difficult for me today after a two day missed in class from Grand Bassa county for a family problem. But, however, I manage to get around the lesson.
Today, we dealt with the topic called functions. Here are the practice works and its
link: www. dropbox.com/s/vq7ecyj4jyb7udn/L5-Functions.pptx
"""
Monday, May 20, 2013
Day 3
Dear Readers!
It is so great to working with Python programing. Our today's lesson was focused around the following:
working with string.......that is the combination of words using quotation with spacing. we use string to construct a complete sentence.
to making my users understand my programing language.
Below are exercises.
"""
Learning Python
Lesson 3 : Strings
Advanced Printing
Simple programming exercises from Codecademy
"""
# Exercise 0 : String Concatenation
"""
Create a variable called breakfast and set it to the
concatenated strings "Spam ", "and ", "eggs".
Then print breakfast to the interactions window.
"""
breakfast = "Spam " + "and " + "eggs"
print breakfast
# Exercise 1 : Explicit String Conversion
"""
Uncomment the print statement below, SAVE and RUN.
What happens?
Use str() to turn 3.14 into a string and SAVE and RUN again.
"""
# print "The value of pi is around " + 3.14 + str(3.14)
# Exercise 2 : String Formatting with %, Part 1
"""
Uncomment the print statement below (Remove the # symbol).
What do you think it'll do?
Once you think you know, SAVE and RUN.
"""
string_1 = "Camelot"
string_2 = "place"
#print "Let's not go to %s. 'Tis a silly %s." % (string_1, string_2)
# Exercise 3 : Print Formatting
"""
For our grand finale, we're showing you a bit of new code.
Don't worry if you don't get how it works yet; we'll explain it soon!
Uncomment the lines below and replace the ___s with the form of %
you need to complete your quest:
%s inside the string, and % to link the string with its arguments.
Answer the questions in the console as they pop up!
Friday, May 17, 2013
Day 2
Dear Reader,
I learn about writing variables. The different kinds of variables are:
1. Strings "Peal"
2. Float 4.5 feets
3. int 20 years
4. Boolean which is True or False
I also learned about white space and Statement, meaning the computer cannot analyze any blank space as variable and statements are not process by the computer it is only meant for the programmer or other to see it.
some results of the test
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>>
Welcome to Python!
Here are the results of Lesson 2
Exercise 0 : Test Passed!
Exercise 1 : Test Failed!
Exercise 2 : Test Failed!
Exercise 3 : Test Failed!
>>> Print "Hellow World"
SyntaxError: invalid syntax
>>> print "Hello World"
Hello World
>>>
Welcome to Python!
Here are the results of Lesson 2
Exercise 0 : Test Passed!
Exercise 1 : Test Passed!
Exercise 2 : Test Failed!
Exercise 3 : Test Failed!
>>>
Welcome to Python!
Here are the results of Lesson 2
Exercise 0 : Test Passed!
Exercise 1 : Test Passed!
Exercise 2 : Test Passed!
Exercise 3 : Test Failed!
>>>
Welcome to Python!
7
3
Here are the results of Lesson 2
Exercise 0 : Test Passed!
Exercise 1 : Test Passed!
Exercise 2 : Test Passed!
Exercise 3 : Test Passed!
>>>
4
Here are the results of Lesson 2
Exercise 1 : Test Passed!
Exercise 2 : Test Failed!
>>>
4
Here are the results of Lesson 2
Exercise 1 : Test Passed!
Exercise 2 : Test Passed!
>>>
>>>
>>>
Comments
Are not meant for analyzing by the computer but only for the programmer and other people. This may either be warning or instruction.
Math Operators
Are those signs use for calculation in python programming/ in writing a code.
Kinds of Programs that I write today:
Variable
data
some of my practice
"""
Learning Python
Lesson 2 : Python Syntax
Variable & Data Type Exercises
Simple programming exercises from Codecademy
"""
# IGNORE THIS CODE
# ***************************************************************
my_variable = my_int = myfloat = this_int = 0
# ***************************************************************
# Exercise 0 : Variables & Data Types
"""
Ready to learn Python?
SAVE this script (File -> Save) and
RUN it (Run -> Run Module)
"""
print "Welcome to Python!"
# Exercise 1 : Variables
"""
Create a variable called my_variable
Set my_variable to the value 10
SAVE & RUN
"""
my_variable = 10
# Exercise 2 : Data Types
"""
Set the following variables to the corresponding values:
my_int to the value 7
my_float to the value 1.23
my_bool to the value True
"""
my_int = 7
my_float = 1.23
my_bool = True
# Exercise 3 : Reassigning Variables
"""
UNCOMMENT the code below
this_int is set to 7 below.
What do you think will happen if we reset it to 3 and print the result?
Change the value of this_int from 7 to 3.
"""
this_int = 7
print this_int
# Change the value this_int from 7 to 3 BELOW
this_int = 3
print this_int
# ************************************************************
# TESTS : DO NOT MODIFY THESE
# ************************************************************
print("")
print("Here are the results of Lesson 2")
print("Exercise 0 : Test Passed!")
if my_variable == 10: print("Exercise 1 : Test Passed!")
else: print("Exercise 1 : Test Failed!")
if my_int == 7 and my_float == 1.23 and my_bool == True: print("Exercise 2 : Test Passed!")
else: print("Exercise 2 : Test Failed!")
if this_int == 3: print("Exercise 3 : Test Passed!")
else: print("Exercise 3 : Test Failed!")
"""
Learning Python
Lesson 2 : Python Syntax
Comments
Simple programming exercises from Codecademy
"""
# Exercise 0 : Single Line Comments
"""
Write a comment below. Make sure it starts with #
It can say anything you like.
"""
# I am really foing to learn this course
# Exercise 1 : Multi-Line Comments
"""
Write a multi-line comment in the editor.
Include whatever text you want!
"""
'''
I love to
work with python
'''
# ************************************************************
# TESTS : DO NOT MODIFY THESE
# ************************************************************
Subscribe to:
Posts (Atom)