-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode
More file actions
66 lines (50 loc) · 1.52 KB
/
code
File metadata and controls
66 lines (50 loc) · 1.52 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Code starts here
# Create the lists
class_1=["Geoffrey Hinton","Andrew Ng","Sebastian Raschka","Yoshua Bengio"]
class_2=["Hilary Mason","Carla Gentry","Corinna Cortes"]
# Concatenate both the strings
new_class=(class_1+class_2)
print(new_class)
# Append the list
new_class.append("Peter Warden")
# Print updated list
print(new_class)
# Remove the element from the list
new_class.remove("Carla Gentry")
# Print the list
print(new_class)
# Create the Dictionary
courses={"Math":65, "English":70, "History":80, "French":70, "Science":60 }
# Slice the dict and stores the all subjects marks in variable
Math=65
English=70
History=80
French=70
Science=60
# Store the all the subject in one variable `Total`
Total= Math + English + History + French + Science
# Print the total
print(Total)
# Insert percentage formula
percentage= Total/5
# Print the percentage
print(percentage)
# Create the Dictionary
mathematics={"Geoffrey Hinton":78,"Andrew Ng":95, "Sebastian Raschka":65,"Yoshua Benjio":50, "Hilary Mason":70, "Corinna Cortes": 66, "Peter Warden":75}
max_marks_scored=max(mathematics,key=mathematics.get)
topper=max_marks_scored
print(topper)
# Given string
topper="andrew ng"
# Create variable first_name
first_name=topper.split()[0]
# Create variable Last_name and store last two element in the list
last_name=topper.split()[1]
# Concatenate the string
full_name=last_name+ " "+ first_name
# print the full_name
print(full_name)
# print the name in upper case
certificate_name=full_name.upper()
print(certificate_name)
# Code ends here