Skip to content

Commit bc621bd

Browse files
committed
add week5 code (without text file)
1 parent 3dbe39d commit bc621bd

2 files changed

Lines changed: 82 additions & 0 deletions

File tree

.idea/workspace.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

week5/week5.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Void Function (just like that bank statement bro)
2+
def multiply_by_5(x):
3+
x *= 5
4+
print(x)
5+
6+
7+
multiply_by_5(5)
8+
print("This is a parameter")
9+
10+
11+
# Return Function
12+
def multiply_by_5(x):
13+
x *= 5
14+
return x
15+
16+
17+
print(multiply_by_5(5))
18+
y = multiply_by_5(5)
19+
y /= 5
20+
print(y)
21+
22+
if multiply_by_5(1) > 5:
23+
print("true")
24+
else:
25+
print("false")
26+
27+
example1 = {"one": "uno", 2: "two"}
28+
print(example1[2])
29+
30+
example1["three"] = 3
31+
print(example1)
32+
33+
example1.pop(2)
34+
print(example1)
35+
36+
age = int(input("How old are you? "))
37+
print("Your age is ", age)
38+
multiply_by_5(age)
39+
print(multiply_by_5(age))
40+
41+
file = open("Week5.txt.txt")
42+
for line in file:
43+
print(line)
44+
45+
for line in file:
46+
if line.startswith("Name"):
47+
print(line)
48+
49+
file = open("Week5.txt", 'w')
50+
file.write("I love Python and FTC!")
51+
file = open("Week5.txt")
52+
for line in file:
53+
print(line)

0 commit comments

Comments
 (0)