8000 Updates · ihf-code/python@7651ab7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7651ab7

Browse files
committed
Updates
1 parent 9da8a85 commit 7651ab7

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

session_05/answers/A5.py renamed to session_05/answers/A11.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# A5 - Rock, Paper, Scissors - Create a simple rock, paper, scissors game which is run against computer.
1+
# A11 - Rock, Paper, Scissors - Create a simple rock, paper, scissors game which is run against computer.
22

33
import random
44

session_06/slides/session_6.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ while times_in_loop <= 10:
197197
x = 1
198198
while x <= 100:
199199
print(x)
200-
times_in_loop = times_in_loop + 1
200+
x = x + 1
201201

202202
for y in range(1, 101):
203203
print(y)

session_10/exercises/exercises_10.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
## Section 10 Exercises
22

33
# Section A
4-
1. Create a Person class, initialise it with a name. Create a method for the Person class that will say hello to the name.
5-
2. Create a Circle class, initialise it with a radius. Create two methods for the Circle class: get_area() and get_circumference() which give both respective areas and circumference, to 2 decimal placese.
4+
1. Create a class called Upper which has two methods called get_word and print_word.
5+
- the get_word method should accept a string from the user
6+
- the print_word method prints the string in upper case.
7+
2. Create a Person class, initialise it with a name. Create a method for the Person class that will say hello to the name.
8+
3. Create a Circle class, initialise it with a radius. Create two methods for the Circle class: get_area() and get_circumference() which give both respective areas and circumference, to 2 decimal placese.
69
- Note: Area of a circle = πr ** 2
710
- Circumference = 2πr
811
- Use the round() function to get the answer to 2 decimal places
9-
3. Create a Employee class and initialise it with name and staff number.
12+
4. Create a Employee class and initialise it with name and staff number.
1013
- i. Make methods to:
1114
- display_info - It should display all the information of the employee.
1215
- set_department - It should assign the department to employee.
@@ -17,13 +20,12 @@
1720
- Given a person's first and last names:
1821
- Form the full_name method by simply joining the first and last name together, separated by a space.
1922
- Form the email_address by joining the first and last name together with a . in between, and follow it with @company.com at the end. Make sure everything is in lowercase.
20-
4. Create a Vehicle parent class, initialise it with, wheels, colour and a method to display all this information.
23+
24+
5. Create a Vehicle parent class, initialise it with, wheels, colour and a method to display all this information.
2125
- i. Create a Tesla (or any car) child classs and add a method to get the miles and a method to display all this information.
2226
- ii. Change the colour of the vehicle.
2327
- iii. Delete the wheels.
24-
5. Create a class called Upper which has two methods called get_word and print_word.
25-
- the get_word method should accept a string from the user
26-
- the print_word method prints the string in upper case.
28+
2729
6. Create a Sandwich class with the attributes order_number and ingredients.
2830
- i. The ingredients attributes is given as a list - (Note: use list(<atrribute>) to enable this).
2931
- Only the ingredients attributes will be given as input.

0 commit comments

Comments
 (0)
0