Being a student of mechanical engineering, i have been avoiding to learn programming seriously.
Although I am familiar with C++ and C, now I am learning Python from EdX course. Notes of which I will attach here. This is for my reference only. I like to type as I listen as it helps me focus on one thing. Generally I get distracted easily.
Although I am familiar with C++ and C, now I am learning Python from EdX course. Notes of which I will attach here. This is for my reference only. I like to type as I listen as it helps me focus on one thing. Generally I get distracted easily.
My python notes
·
Course Schedule
Ends at march 17, hoping to complete it in
February itself.
Submit Assignments and appear for exams in
due time.
Learning Outcomes: Upon completing this course you will be
able to:
Ø
Understand Python expressions and statements
Ø Get
user-input data and manipulate it.
Ø
Understand
simple and compound data types such as integers, floats, strings, lists,
dictionaries, and tuples.
Ø
Implement structures such as if
statements and loops
Ø
Read from and write to external data
files using Python.
Ø
Implement functions and call built-in Python
functions.
Ø
Import and use library function modules
from the Python library.
Ø
Handle programming errors and exceptions.
Ø
Implement useful and fun programs such as
searching, sorting, and solving Sudoku and crossword puzzles
Do these exercises after course is complete(if necessary).
52 Exercises
7:41 PM Thursday, January 14, 2016
Week 1
· - Installed python 3.4.3
· -Difference between IDLE and Shell
· -IDE- integrated development environment-
application that facilitates application development
·
Consists of source code editor, debugger and
automation tools
· -IDLE is IDE for python
· -Completed python basics and now off to Algorithm
vs Program 8:02 pm
· -Algorithm- description of how to solve a
problem, step by step recipe of how to perform a task, can be written in any
language, math equations or a computer language. There can be more than one
algorithm for a same problem
· -Program- implementation of an algorithm in a
programming language, sequence of instructions to a computer
· -Algorithm for Converting from Celsius to
Fahrenheit>>> 20>>>20*9>>>180/5>>>36+32>>>68
· -Using text editor in python IDLE
Week 2 2:00pm
·
Variables and identifiers
· Identifier- a name given to variable, function
or an object.
- They are case sensitive.
- Can only contain letters, numbers and underscores.
- Cannot start with a number, shouldn’t use keywords as an identifier
- Variables- reserved locations in memory to store values
- Variable types – int(integer), float, str(string), bool, list. Dict(dictionary)
- Getting input from user
- Use of prompt is not necessary.
- user_response=input('Your name?') or user_response=input()
- print("I am Sarvil,", user_response)
- Input() returns a string even if the user types a number.
- STATEMENTS, Assignments and expressions
- Expressions- any section of code that evaluates the value
- Statement- executable instruction
- List basics – creating a list
- List- a sequence that holds number of objects, similar to array in C or C++
- 4:52 AM..signing off
No comments:
Post a Comment