-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQ39.py
47 lines (33 loc) · 887 Bytes
/
Q39.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
43
44
45
46
47
#Q. WAF to print the length of a list.(list is the parameter)
# cities = ["Ranchi", "Bhubneswar", "Delhi"]
# def len_list(a):
# print(len(a))
# len_list(cities)
# Output
# 3
#Q. WAF to print the elements of a list in a single line.(list is the parameter)
heroes = ["Thor,", "Captain America,", "Ironman,", "Spiderman"]
# def print_hero(a):
# for i in a:
# print(i, end=" ")
# print_hero(heroes)
# Output
# Thor, Captain America, Ironman, Spiderman
# Q. WAF to find the factorial of n. (n is the parameter)
# def fact(n):
# f = 1
# for i in range(1, n+1):
# f *= i
# print(f)
# n = int(input("Enter a number: "))
# fact(n)
# Output
# Enter a number: 5
# 120
#Q. WAF to convert USD to INR.
def converter(usd_val):
inr_val = usd_val * 83
print(usd_val, "USD = ", inr_val, "INR")
converter(1)
# Output
# 1 USD = 83 INR