Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32
- Type "copyright", "credits" or "license()" for more information.
- >>> a = int(raw_input())
- 9
- >>> b = int(raw_input())
- 10
- >>> dodawnie = a + b
- >>> odejmowanie = a - b
- >>> mnozenie = a*b
- >>> dzielnie = a / b
- >>> print "wyniki dla liczb %f i %f" %(a,b)
- wyniki dla liczb 9.000000 i 10.000000
- >>> print "DODAWANIE: " dodawanie
- SyntaxError: invalid syntax
- >>> print "DODAWANIE: " + dodawanie
- Traceback (most recent call last):
- File "<pyshell#8>", line 1, in <module>
- print "DODAWANIE: " + dodawanie
- NameError: name 'dodawanie' is not defined
- >>> print "DODAWANIE: " + dodawnie
- Traceback (most recent call last):
- File "<pyshell#9>", line 1, in <module>
- print "DODAWANIE: " + dodawnie
- TypeError: cannot concatenate 'str' and 'int' objects
- >>> print "dodawnie: %d" %(dodawnie)
- dodawnie: 19
- >>> print "odejmowanie %d" %(odejmowanie)
- odejmowanie -1
- >>> print "mnozenie %f" %(mnozenie)
- mnozenie 90.000000
- >>> print "dzielnie %f" %(dzielnie)
- dzielnie 0.000000
- >>> dzielenie = float(a) / float(b)
- >>> print "dzielnie %f" %(dzielnie)
- dzielnie 0.000000
- >>> float(dzielenie) = float(a) / float(b)
- SyntaxError: can't assign to function call
- >>> dzielenie = float(a) / float(b)
- >>> print "dzielnie %f" %(dzielnie)
- dzielnie 0.000000
- >>>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement