<file_sep>a = int(input("enter number1: "))
b = int(input("enter number2: "))
if a == b:
    print("true")
else a + b <file_sep>#Write a program to convert binary number to Decimal number
num = int(input("Enter binary number: "))
a = 0
i = 0
#print("decimal representation of ",n,end=" is ")
while (n!=0):
    rem =int(n%10)
    a =a+rem*(2**i)
    n = n/10
    i+=1
print(a)
<file_sep>#Write a Python program to calculate the sum of the digits in an integer
def decimaltobinary(num):
    if num>1:
        decimaltobinary(num//2)
    print(num%2)
a = int(input("enter number: "))
decimaltobinary(a)<file_sep>number1 = int(input("enter number1"))
operator = input("enter operator")
number2 = int(input("enter number2"))
if operator == "+":
    c=number1+number2
    print(c)
elif operator=="-":
    c=number1-number2
    print(c)
elif operator == "*":
    c=number1*number2
    print(c)
elif operator == "/":
    c=number1/number2
    print(c)
else:
    print("error")<file_sep>print(input("enter your name "))
a = int(input("Enter your physics marks "))
b = int(input("Enter your mathematics marks "))
c = int(input("Enter your english marks "))
d = int(input("Enter your chemistry marks "))
e = int(input("Enter your urdu marks "))
Total_marks = a + b + c + d + e
percentage = (Total_marks/500)*100
if percentage >=80:
    print("your percentage is " + str(percentage)+" and Grade is A+")
elif percentage >=70:
    print("your percentage is " + str(percentage)+" and Grade is A")
elif percentage>=60:
    print("your percentage is " + str(percentage)+" and Grade is B")
elif percentage >=50:
    print("your percentage is " + str(percentage)+" and Grade is C")
elif percentage>=40:
    print("your percentage is " + str(percentage)+" and Grade is D")
else:
    print("your percentage is " + str(percentage)+" and you are fail")<file_sep>#student management system
students = []
while True:
    print("\n\nwelcome to student management system", "\n")
    print("press 1 to add student ")
    print("press 2 to delete student")
    print("press 3 to search student")
    print("press 4 to check total enrolled students")
    print("press 5 to exit \n")
    choice = int(input("enter your choice: "))
    if choice == 1:
        student = {}
        student["name"] = input("enter name: ")
        student["father name"] = input("enter father name: ")
        student["phone number"] = input("enter phone number: ")
        student["age"] = input("enter age: ")
        students.append(student)
        print("you added student", student)
        print("list of total student is", students)
    elif choice == 2:
        a = input("enter the name of studnt you want to delete: ")
        for student in students:
            if student["name"].lower() == a.lower():
                s
            print(students)
    elif choice == 3:
        b = input("enter the name you want to search: ")
        for student in students:
            if student["name"].lower() == b.lower():
                print("yes ",b , "is our student")
    elif choice == 4:
        print("total enrolled students are", len(students))
    elif choice == 5:
        break
    else:
        print("you entered invalid choice")



   <file_sep>for i in range(2,10):
    print("ayesha")<file_sep>products = [{'name':'clothes', 'quantity':1}]
while True:
    print("press 1 to sale item ")
    print("press 2 to puchase item")
    print("press 3 to delete product")
    print("press 4 to edit the data")
    print("press 5 to exit")
    choice = int(input("enter your choice"))
    if choice ==1:
        print(products)
    elif choice ==5:
        break<file_sep># topic: variable scoping

# a = 2
# def my_func():
#     a = 9
#     print(a)
# my_func()
# print(a)

#topic: inner functions

# def calculate_taxes(percent):
#     def actual_tax(salary):
#         return salary*percent
#     return actual_tax


# actual_tax_fn = calculate_taxes(0.30)
# print(actual_tax_fn)
# print(actual_tax_fn(1000))


# def calculator(num1,num2,op)
#     def add(n1,n2):
#         return

# while loop
# import random
# temp = random.randint(10,47)
# while temp<45:
#     print("it\'s better weather" , temp)
#     temp = random.randint(30,50)
# print("i came back due to hot weather, temp=", temp)


# #class
# class Human():
#     def __init__(self): #pythons interpreter call it. you dont call it
#         print("i am a constructor")
# Human()
# Human()


# 
class Human():
    def __init__(self , name = "<NAME>", favrt_dish= "biryani"): 
        self.name = name
        print("i am a constructor")

    def set_age(self, favrt_dish):
        self.favrt_dish = favrt_dish


h1 = Human()
h2 = Human("biryani","Ayesha")
h3 = Human()
print(h2.name
print(h1.favrt_dish)]

<file_sep>name="ayesha"
father_name="jawed"
DOB="April 11,1998"
qualification="Bachelors of Engineering"
Interests="Reading, Traveling"
print(name,"\t",father_name,"\n",DOB,"\n",qualification,"\n",Interests)<file_sep>n = int(input("enter no of rows: "))
for rows in range(1, n+1):
    for columns in range (1 , rows+1):
        print(columns, end = "")
    print()
for rows in range(n, 0, 1):
    for columns in range (rows-1,0,1):
        print(columns, end = "")
    print()<file_sep># #print(list(range(1,10,2)))

# # n = int(input("enter rows: "))
# # for i in range(1,n):
# #     print("*"*i)

# a = 2
# b = a
# b = 5
# print(a)
# print(b)

# print("a", end = "" )
# print("a", end = "" )
# print("a", end = "" )
# print("a", end = "" )

# a = "ayesha"
# print(a.upper())
# print(a.lower())
# print(a.capitalize())

#student = ["ayesha", 923408652122, "1998" ]

#dictionaries
student = {
    "name" : "ayesha",
    "cell#" : 923408652122,
    "age" : 21,
    "father name" : "jawed"
}
# print(student)
# print(student["name"])
# student["name"] = "<NAME>"
# print(student)
# student["module"] = "module 1"
# student["course"] = "artificial intelligence"
# print(student)
# del student["module"]
# print(student.pop("name"))
# print(student)

# students = []
# for i in range(3):
#     student = {}
#     student["name"] = input("enter name: ")
#     student["father name"] = input("enter father name: ")
#     student["age"] = input("enter age: ")
#     students.append(student)
# print("currently enrolled students" , len(students))
# for student in students:
#     print("student")
#     print(student)
#     print(students)
#     # if student["name"].lower() == "inam":
#     #     print("yes inam is our student")

print(student.values())
print(student.keys())
print(student.items())
# for k in student:
#     print(student[k])
#     print(k)

print("name" in student)<file_sep>for i in range(1,10)
    print(i)
    print("ayesha")<file_sep>r = int(input("enter radius: "))
print("area of sphere is: ",(4*3.142*r**3)/3)<file_sep>import datetime
v = input("If you want to continue...Yes...\notherwise press any key to exit : ")
print(" ")
while True:
	a = input(":>>")
	if a == "exit" or  a == "no":
		break
	elif a == "date":
		print(datetime.date.today())
	elif a == "name" or a == "your name" or a == "what is your name" or a == "what is your good name":
		print("Osama robot".title())
	elif a == "time":
		print(datetime.datetime.now())
	elif a == "gender" or a == "your gender":
		print("Sorry! no gender")
	elif a == "what are you doing" or a == "what are you doing now":
		print("Answering to you")
	elif a == "bye" or a == "byee":
		print("<NAME>")
	else:
		print(">>"+" "+a.title()+" "+ "\nsyntax error :")
		print(" ")<file_sep>a = int(input("enterheiht in feet: "))
b = a*30.48
print("There are ",b,"Cm in",a,"feet")<file_sep>number=int(input('Enter any Number:'))
if number % 2 == 0:
  print('Number' + str(number) + 'is Even')
else:
   print('Number' + str(number) +'is Odd')<file_sep># # a = int(input("enter number1: "))
# # b = int(input("enter number2: "))
# # def sub(num1,num2):
# #     c = num1 - num2
# #     print(c)
# # def mult(num1,num2):
# #     mul= num1 * num2
# #     print(mul)
# # def div(num1,num2):
# #     divi= num2/num1
# #     print(divi)
# # sub(a,b)
# # mult(a,b)
# # div(a,b)


# # position
# def my_pet(owner, pet):
#     print(owner, "is an owner of ", pet)
# my_pet("cat","Sarah")
# # keyword argument passing
# def my_pet(owner, pet):
#     print(owner, "is an owner of ", pet)
# my_pet(pet="cat",owner="Sarah")

# # default parameter
# def my_pet(owner, pet,city=karachi):#karachi default me dia hua h agr mny neechy argument me pass nh kri tw yh karachi print krdega.. lkn agr defalut nh di hui tw phir parameter pass krna zaruri h
#     print(owner, "is an owner of ", pet,".They are from",city)
# my_pet(pet="cat",owner="Sarah")#yhn city ka parameter hmny nh pass kia tw wo default me karachi print kr dega.. lkjn agr yhn mny city dia kuch or tw wo wahi print krega

# #takes nothing and return something
# def sum():
#     a=2
#     b=3
#     return(a+b)
# result=sum()
# print(result)

# #takes something and returns something
# def sum(val1,val2):
#     result=val1+val2
#     return result
# output_of_result= sum(a.b)
# print(output_of_result)


#task:
#take an input from user , pass it in the argument and return whether it is even or odd
a=int(input('Enter Any Num'))
def even(num):
    if num % 2 == 0:
        return 'Num is Even'
    else:
        return 'Num is Odd'
output=even(a)
<file_sep>#practice
students = ["ayesha" , "ariba" , "hamza"]
print(students)
students.append("alishba")
print(students)
a = students + ["saba" , "shabana" , "iqra"]
print(a)
a[0] = "sania"
print(a)<file_sep>a = int(input())
b= int(input())
c = int(input()
obtain_marks = a+b+c
percentage = (obtain_marks/300)*100
print(obtain_marks, percentage)<file_sep>n = int(input("Enter n: "))
sum = 0
for i in range(0,n+1,1):
    sum = sum+i
print("Sum of",n, "integers is",sum)<file_sep>#write a python program to to compute the future value of specified principle amount, rate of interest and number of years
a = float(input("please enter principle amount: "))
b = float(input("please enter rate of interest in %: "))
c = float(input("enter years of investment: "))
d = a*(1+b)**c
print("After ", c," years your principle amount ", a, "over an interest rate of ",b,"% will be ", d)<file_sep>import random
array = []
for i in range(0,100):
    array.append(random.randint(10,10000))
for j in array:
    print(j)
a = max(array)
print("maximum element of array=", a)
print("index of maximum element of array=", array.index(a))
b = min(array)
print("minimum element of array=", b)
print("index of minimum element of array=",array.index(b))
c = int((sum(array))/len(array))
print("mean of elements of array=",c)<file_sep># n =int(input("Enter Number of Rows: "))
# for row in range(1,n+1):
#     for col in range(1,row+1):
#         print(col,end="")
#     print()
import datetime
print(datetime.datetime.now())
<file_sep>#count alphabet,numbers and special charcters,spaces
word = input("enter word: ").lower()
alphabet = 0
space = 0
number = 0
special_characters = 0
for i in word:
    if i=="a"or i =="e" or i == "o" or i == "u" or i == "i" or  i =="b" or i =="c" or i =="d" or i =="f" or i =="g" or i =="h" or i =="j" or i =="k" or i =="l" or i =="m" or i =="n" or i =="p" or i =="q" or i =="r" or i =="s" or i =="t" or i =="v" or i =="w" or i =="x" or i =="y" or i =="z":
        alphabet = alphabet+1
    elif i == " ":
        space = space+1
    elif i == "1" or i == "2" or i == "3" or i =="4" or i =="5" or i == "6" or i =="7" or i =="8" or i == "9" or i =="0":
        number = number +1
    elif i == "=" or i == "'" or i == ";" or i == ":" or i == "|" or i == "!" or i == "*" or i == "^" or i == "$" or i == "%" or i == "#" or i == "@" or i == "<" or i == ">" or i == ".": 
        special_characters = special_characters+1
print("alphabets =",alphabet)
print("spaces=",space)
print("number=",number)
print("special charcters = ",special_characters)<file_sep>dir(__builtins__)
import math
print(dir(math))
import os
print(dir(os))
<file_sep>#write a python program to get an string which is n copies of a given string
a = input("Enter string: ")
b = int(input("How many copies of string you need: "))
print(a*b)<file_sep>a = str(input("write a line: "))
if a.startswith("is"):
    print(a)
else:
    print("is ",a)
<file_sep>#palidrome tester
a = input("enter text: ").lower()
reverse = a[::-1]
if a == reverse:
    print("enterd text",a," is palindrome")
else:
    print("enterd text",a," is not a palindrome")<file_sep>import random
for i in range(0,10):
    print(random.randint(0,500))<file_sep>n = int(input("enter no of rows: " ))
for rows in range(1, n+1):
    for col in range (1, rows+1):
        print("*", end = "")
    print()
for rows in range(n-1,0,-1):
    for col in range(rows-1,0,-1):
        print("*" , end = "")
    print()<file_sep># a = 9
# b = 2
# c = -5
# d = 10
# e = 11
# print(a+b, a-b, a*b, a/b)
# print(a//b, b**9, a%b)
# print(a&b, a|b, a^b)
# print("a>b")
# print("b<a")
a = 5
while a>5:
    print("ayesha")
    print("jawed")
<file_sep>a = int(input("enter any number: "))
if a % 2 ==0:
    print("number is even")
else:
    print("number is odd")<file_sep>#write a python program to compute the area of triangle
h = int(input("enter height of triangle: "))
b = int(input("enter base of triangle: "))
area = h*b/2
print("area of triangle is ", area)