-
Notifications
You must be signed in to change notification settings - Fork 0
/
day1-exercises.py
47 lines (35 loc) · 1.05 KB
/
day1-exercises.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
## Day 1 - Working with Variables
## 29.05.2023
## Exercises
## print() method
print("Day - 1 Python Print Function")
print("The function is declared like this")
print("print('what to print')")
print("\n\nDay - 1 Python Print Function\nThe function is declared like this\nprint('what to print')")
print("\n\nHello " + "World")
print("Hello" + " World")
print("Hello " + "" +"World")
## Take inputs from users
print("\n\nHello " + input("\nWhat is your name?\n"))
print("\n\n")
print(len(input("What is your name? ")))
## Assign variables
user_name = input('What is your name?') ## changable
print(user_name)
user_name_length = len(user_name)
print(user_name_length)
## Replace variables
# 🚨 Don't change the code below 👇
a = input("a: ")
b = input("b: ")
# 🚨 Don't change the code above 👆
####################################
#Write your code below this line 👇
memory_value = a
a = b
b = memory_value
#Write your code above this line 👆
####################################
# 🚨 Don't change the code below 👇
print("a: " + a)
print("b: " + b)