-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractical_test.py
More file actions
25 lines (18 loc) · 1.07 KB
/
Copy pathpractical_test.py
File metadata and controls
25 lines (18 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 1. Write a program that prompts for the user's first name,
# last name, and age, then outputs a string like: "Hello, <Last Name> <First Name>. Your age is: <Age>."
# 2. Write a program that finds the length of the hypotenuse for a right-angled triangle given its two cathets.
# (c = sqrt(a * a + b * b))
# 3. User inputs the lengths of three sides of a triangle (a, b, c) [float].
# Write a program to check if the triangle is a right-angled triangle (c**2 = a**2 + b**2).
# 3, 4, 5
# 4. User inputs an arbitrary list. Write a program that outputs the elements of the list in reverse order.
# 5. As tuples are immutable, write a program that allows
# adding tuple B to tuple A in a way that tuple B is placed at index 2.
# tuple_A = (1, 2, 3, 5, 8)
# tuple_B = (8, 2, 5) # result = (1, 2, 8, 2, 5, 3, 5, 8)
# 6. Write a program that finds the most frequently occurring number(s) in an
# arbitrary list and returns them in a list.
# x = [1, 1, 2, 3, 4, 4, 4] => [4]
# x = [1, 1, 2, 3, 4, 4] => [1, 4]
# 7. Display the number of seconds as days:hours:minutes:seconds.
# 1234565 => 14:6:56:5