-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay 3
More file actions
33 lines (27 loc) · 728 Bytes
/
Day 3
File metadata and controls
33 lines (27 loc) · 728 Bytes
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
# day 3 # Hacker Rank Problem(What's your name)
def print_full_name(a, b):
print("Hello" + " " + a + " " + b + "! You just delved into python.")
if __name__ == '__main__':
first_name = input()
last_name = input()
print_full_name(first_name, last_name)
Output -
Chetan
Gaur
Hello Chetan Gaur! You just delved into python.
# day 3 (problem 2)
# HackerRank Problem solution( problem mutations)
def mutate_string(string, position, character):
nlist=list(string)
nlist[position]=character
nstring=''.join(nlist)
return nstring
if __name__ == '__main__':
s = input()
i, c = input().split()
s_new = mutate_string(s, int(i), c)
print(s_new)
Output-
chetan
3 m
cheman