Mini-Tutorial Python

print "Halt!"
s = raw_input("Who Goes there? ")
print "You may pass,", s
      
Halt!
Who Goes there? Josh
You may pass, Josh
      
a = 123.4
b23 = 'Spam'
first_name = "Bill"
b = 432
c = a + b
print "a + b is", c
print "first_name is", first_name
print "Sorted Parts, After Midnight or",b23
      
a + b is 555.4
first_name is Bill
Sorted Parts, After Midnight or spam
      
num = input("Type in a Number: ")
str = raw_input("Type in a String: ")
print "num =", num
print "num is a ",type(num)
print "num * 2 =",num*2
print "str =", str
print "str is a ",type(str)
print "str * 2 =",str*2
      
Type in a Number: 12.34
Type in a String: Hello
num = 12.34
num is a  
num * 2 = 24.68
str = Hello
str is a  
str * 2 = HelloHello
      
AnteriorInicioSiguiente