-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearnPython2.py
47 lines (46 loc) · 997 Bytes
/
learnPython2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#Learning Python
"""This is a
multiline
Comment."""
import datetime
time = datetime.datetime.now()
print(time)
print("Hello, World!")
x = 5
y = 10
print(x)
print(y)
print(10*5)
name = "John"
a = "awesome"
print("Python is " + a)
print(x + y)
#If you try to combine a string and a number, Python will give you an error
print(name)
p=int(1)
q=int(1.8)
r=float(3.8)
s=float(3)
print(p,q,r,s)
print(name.lower())
print(name.upper())
z = input("Enter Your Name: ")
print("Hello," + z)
if x==5:
print "X is five"
while x < 10:
print(x)
x += 1
if x!=4:
print("X is not Four")
print("X is greater than 3 and less than 6:", x>3 and x<6)
fruits=["Apple","Banana","Mango","Strawberry"]
fruits[1]="Grapes"
fruits.append("Cherry")
print(fruits)
fruits.pop(1)
print(fruits)
for x in fruits:
print(x)
if x == "Mango":
break