Skip to content

Instantly share code, notes, and snippets.

@inesusvet
Created February 23, 2019 13:54
Show Gist options
  • Save inesusvet/8a3a1a879179cb8047c0e272765761e0 to your computer and use it in GitHub Desktop.
Save inesusvet/8a3a1a879179cb8047c0e272765761e0 to your computer and use it in GitHub Desktop.
Introduction to Python 2019-02-23
a = 'space'
print(a)
a = 100500
print(a)
a = -6.5
print(a)
def start():
print('start')
start()
pi = 3.141529
def square_circle(radius):
return pi * radius ** 2
s = square_circle(2)
print(s)
s1 = square_circle(20)
print(s1)
people = ['Lera', 'Dasha', 'Tanya', 'Vanya', 'Kate', 'Misha']
print(people)
example = [1, 'Vasya', pi]
print(example)
victim = people[2]
print('How are ' + victim + '?')
people[2] = 'Vasya'
print(people)
print(len(people))
def short(some_list):
return [
some_list[0],
some_list[len(some_list) // 2],
some_list[-1],
]
print(short(people))
a = 100
if a > 0:
print('Positive')
if a > 1001:
print('Too much!!')
elif a < 0:
print('Negative')
else:
print('Zero')
for person in people:
print(hello(person))
print(person)
print('finish')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment