Posts

Showing posts from October, 2022

what is variable in python Interview question

 variable --variable is a container that store the data-- ---variable are used to hold data during execution of the programm example: a=5 a is variable which store 5

What is Data python Interview question

 Data is any piece of information which is used by the program to acomplish a task : - Example of task- Find the sum of two number:                                Find Lcm of two number:

How to develop a software using python

 How to develop a software  using python

Where python can be used

 Where python can be used 1) Developing websites 2) Task automation 3) Data Analysis 4) AI,ML,IOT 5)Developing desktop application

large organization that uses python ,python used in this big companies

 Amazing facts about python -- Ranked 1 (TIOBE report) #large organization that uses python Google Netflix Dropbox Youtube Instagram microsoft NASA facebook mozila amazon

Features of python

 Features of python 1)  Simple and straight forward syntax 2) platform independent 3) large library 4) precise coding 5) automatic memory management 6) highly extensible

Why you should learn python

 Why you should learn python  1) Huge community support 2) Future with Artificial Intelligence and machine learning 3) Easy to learn and implement

HIstory and version of python

- python was conceived in 1980 by Guido van  Rossum. #version  history python 1.0-- 1994 python 2.0--2000 python 3.0--2008 #latest version python 3.10.6--2 August 2022 #Name python python developers aim for it to be fun to use the name python is tribute to the British  comedy show monty python

Write a python script to print first 10 multiples of 5

  #. Write a python script to print first 10 multiples of 5 a=int(input( "Enter the number" )) i= 1 while i<= 10 :     print(a*i)     i+= 1    

Write a python script to print first N natural numbers

  Write a python script to print first N natural numbers a=int(input( "Enter the number" )) i= 1 while i<=a:     print(i)     i+= 1

Write a python script to print first N odd natural numbers

  #Write a python script to print first N odd natural numbers a=int(input( "Enter the number" )) i= 1 u= 0 while i<=a:     if i% 2 != 0 :      print(i)     i+= 1

Write a python script to print first N odd natural numbers in reverse order

  #Write a python script to print first N odd natural numbers in reverse order a=int(input( "Enter the number" )) i= 1 while a>=i:     if a% 2 != 0 :         print(a)     a-= 1

Interview question of list in python,practice question of list in python

  #Write a python program to store all the programming languages known to you using #Set a={ "python" , "java" , "javascript" , "c++" } print(type(a))   # Write a python program to store your own information {name, age, gender, so on..} a={ "rajendra" , 18 , "male" } print(a)   #Write a Python script to find if “Python” is present in the set thisset = {"Java", #"Python", "Django"} thisset={ "java" , "python" , "Django" } print( "python" in thisset) #Write a python program to add items from another set to the current set. thisset = #{"Java", "Python", "SQL"} #secondset= {"C", "Cpp", "NoSQL" a={ "java" , "python" , "sql" } b=( "c" , "cpp" , "nosql" ) print(a.union(b)) #Write a python program to add elements of list to a set #thisset = {"

Write a python script to store an octal number 125 in a variable and print it in binary format

# Write a python script to store an octal number 125 in a variable and print it in binary #format a= 0o 125 print(bin(a))

Write a python script to store a hexadecimal number 2F in a variable and print it in octal format.

  #. Write a python script to store a hexadecimal number 2F in a variable and print it in #octal format. a= 0x 2F print(oct(a))

Write a python script to store binary number 1100101 in a variable and print it in decimal format.

  #Write a python script to store binary number 1100101 in a variable and print it in #decimal format. a= 0b 1100101 print(a)

Write a python script to print any number and its octal equivalent.

  # Write a python script to print any number and its octal equivalent. a= 4 print(oct(a))

Write a python script to print any number and its binary equivalence

  #Write a python script to print any number and its binary equivalen a= 5 print(bin(a))

Write a python script to print Unicode of the character ‘m’

  # Write a python script to print Unicode of the character ‘m’ a= 'm' print(ord(a))

write a python script to convert a number into str type

  #write a python script to convert a number into str type a= 5 print(str(a))

Write a python script to display the current date and time. First create variables to store date and time, then display date and time in proper format (like: 13-8-2022 and 9:00 PM """

  """ Write a python script to display the current date and time. First create variables to store date and time, then display date and time in proper format (like: 13-8-2022 and 9:00 PM """ from datetime import datetime dt=datetime.today() d1=dt.strftime( "%d-%m-%y and %I-%m-%p" ) print(d1)

Write a python program script to print all the keywords

  #  Write a python script to print all the keywords import keyword print(keyword.kwlist)

(python )calculator using match case in python switch the particular value between different cases :

  #calculator using match case # it switch the particular value between different cases : # index: print( "1= Addition" ) print( "2= Subtractin" ) print( "3= multiplication" ) print( "4= division" ) # user choice: choice=int(input( "Enter your choice:" )) # match case match choice:     case 1 :         print( "Enter two number:" )         a,b=int(input()),int(input())         c=a+b         print( "sum is:" ,c)             case 2 :         print( "Enter two number:" )         a,b=int(input()),int(input())         c=a-b         print( "subtraction is:" ,c)                     case 3 :         print( "Enter two number:" )         a,b=int(input()),int(input())         c=a*b         print( "multipication is:" ,c)                       case 4 :         print( "Enter two number:" )         a,b=int(input()),int(input())         c=a/b         print( "division is:&quo

Write a Python script to create a list of first N even natural numbers.

  #Write a Python script to create a list of first N even natural numbers. list=[] num=int(input( "Enter the numbers:" )) for i in range( 1 ,num):     if i% 2 == 0 :         list.append(i)   print(list) print(type(list))    

write a python programm to print 1 to 100 prime number

  # write a python programm to print 1 to 100  prime number a= 1 while a<= 100 :     i= 1     count= 0     while i<=a:         if a%i== 0 :             count=count+ 1         i+= 1     if count== 2 :         print(a)     a+= 1    

Write a python program to integral qotient and remainder of a division:

  # Write a python program to integtral qotient and remainder of # a division: num= 2500 den= 235 qua=num//den remi=num%den print(qua,remi)💕💔

Write a python programm to check two given integers and print true if one of them is 30 or if thier sum is 30 else pri fal

  #Write a python programm to check  two given integers and print #true if one of them is 30 or if thier sum is 30 else pri fal a=int(input( "Enter first number:" )) b=int(input( "Enter second number:" )) if a== 30 or b== 30 or a+b== 30 :     print( "True" ) else :     print( "False" )

write a python programm that convert kilometers per hour to miles per hour:

  #write a python programm that convert kilometers per hour # to miles per hour: km=int(input( "Enter kilometer per hour" )) miles=km* 0.6213712 # 1km=0.6213712 print(miles)

Write a python programm that convert centigrade to fahrenhiet

  #Write a python programm that convert centigrade  to #fahrenhiet celcius=int(input( "Enter  temp in celcius" )) fah=(celcius* 1.8 )+ 32 print(fah)

write a python programm that read 5 number and sum of all odd value between them

  #write a python programm that read 5 number and sum of all odd #value between them i= 0 sum= 0 while i< 5 :     num=int(input( "Enter the number" ))     i+= 1     if num% 2 != 0 :         sum=sum+num         print( "sum of odd value is:" ,sum)

Write a python programm to reada 5 number and counts the number of positive number and print the average of all positive values.

  #Write a python programm to reada 5 number and counts the #number of positive number and print the average  of all #positive values. i= 0 pos= 0 sum= 0 while i< 5 :     num=int(input( "Enter the number" ))     i+= 1     if num> 0 :         pos=pos+ 1             if num> 0 :         sum=sum+num         print( "Positiv number:" ,pos) print( "Average of positive number:" ,sum//pos)

write a program to read 5 numbers and counts the number of positive and negative number

  #6 write a program to read 5 numbers and counts the number #of positive and negative number     i= 0 pos= 0 neg= 0 while i< 5 :     num=int(input( "Enter the numbers:" ))     i+= 1     if num> 0 :         pos=pos+ 1             else :         neg=neg+ 1 print( " Total positive number is:" ,pos) print( "Total negative number is:" ,neg)

Write a python programm that read an integers between 1 and 12 and print the month of the year in English

  #5Write a python programm that read an integers between # 1 and 12  and print the month of the year in English month=int(int(input( "Enter number between 1 to 12 :" ))) match month:     case 1 :         print( "january" )     case 2 :         print( "February" )     case 3 :         print( "march" )     case 4 :         print( "April" )     case 5 :         print( 'May' )     case 6 :         print( "june" )     case 7 :         print( "July" )     case 8 :         print( "August" )     case 9 :         print( "September" )     case 10 :         print( "October" )     case 11 :         print( "November" )     case 12 :         print( "December" )

Wrtite a python programm that reads two integers and cheks whether they are multiple or not

  #4 Wrtite a python programm  that reads   two integers and #cheks whether they are multiple or not a=int(input( "Enter the first number:" )) b=int(input( "Enter the second number:" )) if b%a== 0 :     print( "multiplied" ,) else :     print( "Not multiplied" )

Write a python programm to read 5 number and sum of all odd values between them.

  #Write a python programm to read 5 number and sum of all #odd values between them. i= 0 sum= 0 while i< 5 :     num=int(input( "Enter the number" ))     i+= 1     if num% 2 != 0 :         sum=sum+num                 print(sum)

write a python programm to convert a given integer (in days) to year,month,days assume that all month have 30 days all year have 365 day

  #Q2-write a python programm to convert a  given integer #(in days) to year,month,days assume that all month have 30 days # all year have 365 day days=int(input( "Enter days:" )) year=days// 365 day=days% 365 month=day// 30 day=day% 30 print(year, 'year' ) print(month, 'month' ) print(day, 'days' )

write a python programm to convert a given integer(second) to hour,minute, second.

  # write a python programm to convert a given integer(second) # to hour,minute, second. sec=int(input( "Enter Second" )) hour=sec// 3600 # 25300//3600=7hour second=sec% 3600 #25300%3600=100 minute=second// 60 # 100//60= 1 minute second=second% 60   # 100%60=40 second print( "H:M:S-" ,hour, ':' ,minute, ':' ,second)

Supermarket App using python- ( Python Project)

#-----------------SUPERMARKET MANAGEMENT SYSTEM-------------------- items = [] while True :     print( '------------------Welcome to the supermarket------------------' )     print( '1. View items\n2. Add items for sale\n3. Purchase items\n4. Search items \n5. Edit items\n6. Exit' )     choice = int(input( 'Enter the number of your choice : ' ))     if choice == 1 :         print( '------------------View Items------------------' )         print( 'The number of items in the inventory are : %d ' %len(items))         if len(items) != 0 :             print( 'Here are all the items available in the supermarket.' )             for item in items:                 for key, value in item.items():                     print( "%s : %s " %(key, value))                 elif choice == 2 :         print( '------------------Add items------------------' )         print( 'To add an item fill in the form' )         item =