Lists Redux

Combining Lists append( list ) >>> a_list = [1, 2, 3] >>> a_list.append( [4, 5] ) >>> a_list [1, 2, […]

Read More
Comments Off on Lists Redux

APPENDIX

print(“Bashar”) dir(str) help(print) help(str.rjust) “Bashar”.rjust(35) input(“What is your name?”) if name == “Bashar”: print(name + ” is a lumberjack!”) { […]

Read More
Comments Off on APPENDIX

Guess The Number!

My Solution Guess a number from 1 to 10 game. import random def init_game(): print(“Guess a number between 1 and 10. […]

Read More
Comments Off on Guess The Number!

Putting the “Fun” Back in “Function”

Introduction To Functions Definition def say_hello( ): print(“Hello!”) Arguments def add_to_two(num): print(num+2) >>> add_to_two(2) 4 Return def square(num): return num*num […]

Read More
Comments Off on Putting the “Fun” Back in “Function”

Shopping List

Lists Lists my_list = [ 1, 2.5, ‘a’ ] >>> list(‘a’) # Function creates a list of characters from the […]

Read More
Comments Off on Shopping List

Things That Count

Numeric Variables a = 1, b = 2 c = a + b >>> print(c) 3  int( variable ) [string_multiply]: input_string […]

Read More
Comments Off on Things That Count

Ins & Outs

Input/Output Output: print(“Bashar”) Input:    input(“What is your name?”) >>> name = input(“What is your name? “) What is your name? Bashar >>> print(name) Bashar String Concatination [lumberjack.py]: name = input(“What’s your name? “) […]

Read More

Say Hello to Python

At the end of this course, we’re going to build a Guess the Number game. There are two ways to […]

Read More

Setup A Python Environment

Installing Python from http://www.python.org To automatically be able to access python through the command prompt, Make sure to install Add python.exe […]

Read More
Comments Off on Setup A Python Environment