You are on page 1of 3

z[Dictionary]

b={"A":["Apple", "An", "Alabama"],

"B":["Ball", "Bat", "Bob"],

"C":["Cat", "Cap", "Cartoon"]}

print(b["C"])

[List]
a=[10, 20, 30, "Hello", "Nigad", 405.3]

print (a)

[Equation 1]
x=int(input("Enter the value of x :"))

print ("y = :", 3*(x/2))

[Equation 2]
b=int(input("Enter the value of b :"))

c=int(input("Enter the value of c :"))

print ("z =", 3*b*c+4)

[Equation 3]
x=int(input("Enter the value of x :"))

b=int(input("Enter the value of b :"))


print ("a =", (x+2)/(b-1))

[To accept a number and print its double]


x=int(input("Enter the Number :"))

print ("Double of the number =", x*2)

[To display full name]


x=input("Enter your first name :")

y=input("Enter your last name :")

print (x+y)

[To print the square of a number]


x = int(input("Enter the number :"))

print ("Square of the number is =", x**2)

l=[]

n=int(input("Enter no. of elements:"))

for i in range(n):

v=input('Enter element '+str(i+1)+':')

l.append(v)

print(l)
for i in l:

if i in '1234567890':

i=int(i)

if type(i)==int:

print('{',i,'}')

else:

print('#',i,'#')

You might also like