forked from AvishkaSooriyapperuma/Python1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSample.py
More file actions
37 lines (33 loc) · 1.21 KB
/
Sample.py
File metadata and controls
37 lines (33 loc) · 1.21 KB
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
import turtle
print ("Hello, Python")
print ("This is a sample Python file for Python basics.")
print ("Here we discuss basic input and print methods.")
print () # Insert piece 1 below
b="Given below is turtle command."
print (b)
qazi_turtle=turtle.Turtle()
qazi_turtle.forward(100)
qazi_turtle.right(90)
qazi_turtle.forward(100)
qazi_turtle.right(90)
qazi_turtle.forward(100)
qazi_turtle.right(90)
qazi_turtle.forward(100)
print () # insert piece 2 below
print ("This is a command to display what is stated inside paranthesis")
print (5)
print (67)
print ("This is Python")
print ("This is the world's most popular programming language")
print () #insert piece 3 below
var = 1
print (var)
var2 = 45
print (var2)
n = input ("Insert your number below: ")
print (n)
print ("Sample code ends here.")
print("Here we will talk about Sequences and Lists.")
Family=['Mother','Father','Brother','Sister'] #Every element get an index from the start. First one starts with zero.
Family[0] # We can use this to get the value for the entered index number.
Family[-2] # We can use the index numbers from the end to the start too. When we use it like this the ending index is -1. and the one one before it is -2, like this it goes on.