-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
35 lines (29 loc) · 694 Bytes
/
test.py
File metadata and controls
35 lines (29 loc) · 694 Bytes
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
""" #Multiline Comment Used
#print('Hello. First python lesson in college.')
#for i in range(0,100,10):
#print(i)
#fibonocci series
#a =0
b =1
print(a)
print(b)
for i in range(0,10,1):
temp=a
a=b
b=temp+b
print(b)
#
#Swapping Two Numbers
n1=int(input("Enter the first number:"))
n2=int(input("Enter the second number:"))
temp=n1
n1=n2
n2=temp
print("First Number is:",n1)
print("First Number is:",n2)
"""
text = "PythonSlicing"
print(text[0:6]) # 'Python' (Characters from index 0 to 5)
print(text[:6]) # 'Python' (Start defaults to 0)
print(text[6:]) # 'Slicing' (Stop defaults to end)
print(text[::-2]) # 'PythonSlicing' (Copies the entire string)