@junaidtomlin_francis/

Python year 11 - Data Types

Python

No description

fork
loading
Files
  • main.py
main.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
 # Task 1
# Take a users input and store this as the variable name
name = input("What is your name?")
# Display the variable name to the user
print("Hello",name)

# What type of variable is name? 

# Response - 

# Example - I will repeat your name 64 times
print("I will show your name 64 times")
print(name * 64)

# Take a users input
repeat = int(input("Please enter a number"))

# Prompt to the user
print("Hello",name,", I will repeat your name",repeat,"times.")

# Example - I will repeat your name a number of times
print(name * repeat)

# What type of variable is repeat?

# Response - 

# What is the difference between name and repeat? 

# Response - 

#Task 2
print()
print("-"*64)
print()
# Complete the code below to work out the area of a room.
length = input("What is the length of your room (cm)?")
width = input("What is the width of your room (cm)?")

area = length * width

print("The area of the room is:",area)