1. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jun 2013
Posts
3
Rep Power
0

#### Python Programming help

i do not know that what is the python programming. i want to know about this topic.
2. With two transistors your clever electrical engineer can build an inverter. Logically, that's the "not" function. With a few more transistors, we can make an `exclusive or' circuit. Let's examine truth of these circuits. Think of 0 as "no current" or "low voltage", and 1 as "current flows" or "high voltage" (needn't be dangerously high).
Not. One input. One output.
Code:
```Input   Output
0       1
1       0```
Xor. Two inputs, One output. Let's name the inputs I1 and I2.
Code:
```I1 I2   O=I1^I2
0  0    0
0  1    1
1  0    1
1  1    0```
Hey! Check this out. If we add 0 + 0 we get 0. And adding 0+1 or 1+0 gives 1. Whoo-hoo. Adding 1+1 give 2. 2? Never mind. With an xor gate (eh...circuit) we can perform all these operations: 0+0, 0+1, 1+0.

Now to stretch your imagination. Let's think about base 10. Ten fingers. Ah, skip this dialog of Roman numerals and the abacus. Let's count with arms. Wait, that won't work. Let's count with lights. We'll use a bright light and an orange light. When the bright light is on it means "1". For the orange light, on means "one group of two ones".
I1 xor I2 controls the bright light;
I1 and I2 controls the orange light.
Now we can add all combinations of addends 0, 1 and represent the result! By extension we envision adding larger numbers. We can think of the orange light as the carry. Oh dear, trouble. Considering the carry, we need three input circuits. Maybe you, along with your clever electrical engineer can think of ways to combine two input circuits using George Boole's fantastic tables to make a three input circuit with the right properties for addition.

Warning: big jumps here. We'll stick a clock onto our circuit, and some memory, and some control circuits. The program indicates which circuits to activate during the clock cycle. The data changes, the computer can move it somewhere.

Python schedules circuit activation. Both humans and the digital circuit can understand the description. Wow! Python is a language for controlling machines. Ignore that machines have moving parts but computers no longer need moving parts.
3. No Profile Picture
Contributing User
Devshed Newbie (0 - 499 posts)

Join Date
May 2013
Location
/dev/null
Posts
170
Rep Power
22
4. A real eye opener ...
http://docs.python.org/2/tutorial/

Something practical ...
go to
ideone.com
select python
in the editor area type
Code:
`print('hello world')`
and submit

Contrast that with C ...
got to
ideone.com
select C
in the editor area type
Code:
```#include <stdio.h>

int main()
{
puts("hello world");
return 0;
}```
submit and look at the output.

• b49P23TIvg agrees : Enchanted to see puts instead of inefficient printf .
Last edited by Dietrich; June 3rd, 2013 at 10:42 AM.
5. Originally Posted by mostakin
Now we can add all combinations of addends 0, 1 and represent the result! By extension we envision adding larger numbers. We can think of the orange light as the carry. Oh dear, trouble. Considering the carry, we need three input circuits. Maybe you, along with your clever electrical engineer can think of ways to combine two input circuits using George Boole's fantastic tables to make a three input circuit with the right properties for addition.

So wait. You're obviously sharp enough to get b4's sarcasm but you post on a forum to ask what is Python? There are more good, basic Python tutorials and free books out there than you will EVER need. Just go Google...

I can never understand WHY people post on forums asking for detailed, basic info. We have better things to do. Like helping other posters with their real problems. No one has time to re-write what is all over the net. Besides, why would you even trust some strange guys answers? He might be be messing with you or... an idiot or something.

If you want to program the FIRST thing you need to accept is that research is a big part of it. No matter how advanced you get you still need to know where to look to find the answers that you need. Might as well start now!

• Mekire agrees : Actually he is just a spammer. He cut and pasted his reply out of the body of b4's post.
6. No Profile Picture
Registered User
Devshed Newbie (0 - 499 posts)

Join Date
Jun 2013
Posts
3
Rep Power
0

#### tutorial site

you have know my topic then you give me a tutorial site.