Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
#Learning Python online
'''
# sum example
num1 = 1.5
num2 = 6.3
num3 = 3.5
num4 = 3334.3
# Add two numbers
sum = float(num1) + float(num2)
sum1 = float(num1) + float(num2)
# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
print('the sum of {0} and {1} is {2}'.format(num3, num4, sum1))
'''
'''
# square root example
num = 8
num_sqrt = num ** 0.5
print('the square root of %0.3f is %0.3f' %(num,num_sqrt))
'''
'''
# square root example using complex numbers
import cmath
num = 8 +3j
num_sqrt = cmath.sqrt(num)
print('The square root of {0} is {1:0.3f}+{2:0.3f}j'.format(num ,num_sqrt.real,num_sqrt.imag))
'''
'''
print('This sentence is output to the screen')
# Output: This sentence is output to the screen
a = 5
print('The value of a is', a)
# Output: The value of a is 5
'''
'''
print(1,2,3,4)
# Output: 1 2 3 4
print(1,2,3,4,sep='*')
# Output: 1*2*3*4
print(1,2,3,4,sep='#',end='&')
# Output: 1#2#3#4&
'''
'''
print('I love {0} and {1}'.format('bread','butter'))
print('I love {0} and {1}'.format('bread', 'butter'))
# Output: I love bread and butter
print('I love {1} and {0}'.format('bread','butter'))
# Output: I love butter and bread
print('Hello {name}, {greeting}'.format(greeting = 'Goodmorning', name = 'John'))
'''
#Python Input
num = input('Enter a number: ')
print(num)