-
Notifications
You must be signed in to change notification settings - Fork 0
/
main3(tut).py
54 lines (36 loc) · 1.1 KB
/
main3(tut).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
48
49
50
51
52
53
54
# Dict = {"Kiran": "Programmer", "Saurav Rai": "Hacker", "Dipika": {"As a": "Friend only", "Sometime\s as a": "close friend", "Sometime'\s as a ": "May be girlfriend"}}
# print(Dict["Dipika"]["As a"])
# print(Dict.items())
# Question: Create a dictionary and take input from the user and return the meaning of the word from the dictionary
# D = {
# "Kiran": '53kg',
# "Anil": '65kg',
# "sunil": '55kg',
# "saurav": '50kg'
# }
# name = input("Enter your name to get your weight")
# print(D[name])
# set in python
# l = [1,2,3,4]
# s_from_list = set(l)
# print(type(s_from_list))
# method to add a items in set
# s = set()
# s.add(1)
# print(s)
# if else statement
# var1 = 3
# var2 = 5
# var3 = input()
# if var3>var2:
# print("Greater")
# else:
# print("Lesser")
# Exercise 2 - Faulty Calculator
# 45 * 3 = 555, 56+9 = 77, 56/6 = 4
# Design a calculator which will correctly solve all the problems except
# the following ones:
# 45 * 3 = 555, 56+9 = 77, 56/6 = 4
# Your program should take operator and the two numbers as input from the user
# and then return the result
#