Download Untitled

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Week 8
last time
machine learning
this time
C
Python
#include<stdio.h>
intmain(void)
{
printf("hello,world\n");
}
print("hello,world")
defmain():
print("hello,world")
if__name__=="__main__":
main()
functions
printf("hello,world\n");
print("hello,world")
loops
while(true)
{
printf("hello,world\n");
}
whileTrue:
print("hello,world")
for(inti=0;i<50;i++)
{
printf("hello,world\n");
}
foriinrange(50):
print("hello,world")
variables
inti=0;
i=0
Boolean expressions
i<50
x<y
conditions
if(x<y)
{
printf("xislessthany\n");
}
elseif(x>y)
{
printf("xisgreaterthany\n");
}
else
{
printf("xisequaltoy\n");
}
ifx<y:
print("xislessthany")
elifx>y:
print("xisgreaterthany")
else:
print("xisequaltoy")
arrays
argv[0]
sys.argv[0]
source code
defmain():
print("hello,world")
compiler
bytecode
20LOAD_GLOBAL0(print)
3LOAD_CONST1('hello,world')
6CALL_FUNCTION1(1positional,0keywordpair)
9POP_TOP
10LOAD_CONST0(None)
13RETURN_VALUE
interpreter
clanghello.c
./a.out
pythonhello.py
./hello
cs50.get_char
cs50.get_float
cs50.get_int
cs50.get_string
...
bool
float
int
str
...
...
complex
list
tuple
range
set
dict
...
http://www.symfony-project.org/jobeet/1_2/Propel/en/04
flask.pocoo.org
Week 8
Related documents