Python week 1
Python week 1
number = -10.6
name = "Programiz"
# print literals
print(5)
# print variables
print(number)
print(name)
Output
5
-10.6
Programiz
output
Programiz is awesome.
3. Output formatting
x=5
y = 10
output
15
amount = 150.75
print("Amount: ${:.2f}".format(amount))
output
Amount: $150.75
4. Python User Input
Output
Enter a number: 10
You Entered: 10
Data type of num: <class 'str'>