Thursday, April 15, 2021

Python online training contents

for python online classes. please contact 8897520530

or whatsup--8897520530

skype-durgam.anil1@gmail.com


for contents please click on below link

Thursday, April 8, 2021

MM32F MCUs delay in ms(milli seconds) and us(microseconds)

static u8 fac_us = 0;
 static u16 fac_ms = 0;
 extern u32 SystemCoreClock;
 void delay_init() 
 SysTick_CLKSourceConfig(SysTick_CLKSource_HCLK_Div8);
 fac_us = SystemCoreClock / 8000000;
 fac_ms = (u16)fac_us * 1000; } void delay_us(u32 nus) { u32 temp; SysTick->LOAD = nus * fac_us; SysTick->VAL = 0x00; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk ; do { temp = SysTick->CTRL; } while((temp & 0x01) && !(temp & (1 << 16))); SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->VAL = 0X00; } void delay_ms(u16 nms) { u32 temp; SysTick->LOAD = (u32)nms * fac_ms; SysTick->VAL = 0x00; SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk ; do { temp = SysTick->CTRL; } while((temp & 0x01) && !(temp & (1 << 16))); SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk; SysTick->VAL = 0X00; }

Tuesday, April 6, 2021

input function in python

# -*- coding: utf-8 -*- """ Created on Tue Apr 6 22:22:06 2021 @author: Onyx1 #input from the user #syntax:input() a=input() b=input() print(a+b) a=int(input("please enter number") ) #string type b=int(input("please enter number ")) #string type print(a,type(a)) print(b,type(b)) print(a+b) a=input("enter your name") print(a, type(a)) a =float(input("please enter floating values")) print(a,type(a)) a= int(input("enter number")) print(a,type(a)) """ #raw_input------python 2.x version input

doc string in python

""" #docstring def basha(): ''' company name:Harish company author:Harish program description: addition , substraction, multiplication functions file date of started:06-04-2021 date modified:08-04-2022 second user: '''''' print("Basha") #__doc__ -------> docstring print(basha.__doc__) ''' def basha1(): """ company_name:Harish company author:Harish program description: addition , substraction, multiplication functions file date of started:06-04-2021 date modified:08-04-2022 second user: """ print("Basha") #__doc__ -------> docstring print(type(basha1)) print(basha1.__doc__) '''

Monday, April 5, 2021

operators in python

""" Created on Mon Apr 5 21:18:07 2021 @author: Onyx1 #class-3-05-04-2021 #addition a=10 b=20 print(a+b) #substraction print(b-a) print(a-b) #multiplication print(a*b) #division print(a/b) #floor division print(a//b) #power print(a**b) #python 2.x print("anl") #operators #arthimatic operation #assignment operators #logical operators #conditional #identify #membership #bitwise #arthimatic operation # +,-,*,/,%,//,**---> operators #assignment operators a=10 b=20 a=a+b b=b-a a=a*b print(a) b=30+50 print("b-",b) a=20 b=10 a=a/b print(a) a=20 b=10 a=a//b print(a) a=20 b=10 a=a**b print(a) #logical operators #& | ! #and a=4#0100 b=2#0010 a = a & b print(a) a=10#1010 b=8#1000 a = a & b print(a) a=4 #0100 b=2 #0010 harish=a|b #0110--6 print(harish) #not....not available a=2 #0010 a!=3 #0011 print(a) #conditional operator a=5 a==5 #5==5 if (a==5): print("this is harish") a>5 #comparison greater than a<4 #comparison less than a<=5 #less than or equal to a>=10 # greater than or equal to a!=10 #not equal to #identify #is #is not #is if two values true then return True same object #is not if two value not True then return False same object x=["rose","lilli"] b=["rose","lilli"] a=x #print(a,x) #print(id(a),id(x)) #print(b,id(b)) print(x is a) #true print(x is b) #False print(x is not b)#True print(x is not a)#false """ #membership #in #not in x=["rose","lilli"] print("rose" in x) #if member exist ---true print("chicken" not in x ) #not exist ---true print("lilli" not in x ) #false

Saturday, April 3, 2021

Operations on numbers in python

dd=3
mm=4
yyyy=2021
print(dd,mm,yyyy,end="",sep="kfdjdskjgshgjhsfdjghdsjfg")
print("03-04-2021")
dd=3
mm=4
yyyy=2021
#print("dd-",dd,"mm-",mm,"yyyy-",yyyy,end="",sep="")
#print("03-04-2021")
#print("dd{}-mm-{}-yyyy-{}".format(mm,dd,yyyy))
#print("%d-%d-%d",dd,mm,yyyy)
#print(dd,mm,yyyy)
#boolean=2values
#True----->1
#False---->0
a=True
print(a)
a=False
print(a)
print(True)
print(False)
#operations on number
#+,_,/,%,**,<,>>=,<=,!,!=
#addition---'+'
a=1054545454545454545454421231545313248432132454
b=206545423132468484543545484843415454564545121324874987524154879848544564654564564654548798798
a=a+b
#print(a)
a=a+a+b+a+a+b+b+a+a+b+b+b+b+a+a+b+b+a+a+b+a+b+b+b
b=a+a+b+a+a+b+b+a+a+b+b+b+b+a+a+b+b+a+a+b+a+b+b+b
#print(a+b)
#subtraction ---'-'
a=20
b=10
c=a-b
print(c)
#multiplication---'*'
a=205454564545454545132132156456451234156456451545456456451341
b=10657484564354846454654845645467484546546546
c=454545454546545453423132545454545465456456454554
print(a*b*c)
print(a*b*c*a*b*c)
#BODMAS
#B-brackets
#O-of
#D-division
#M-multiplication
#A-addition
#s--substraction
print((5*4)+10)
#division---'/' a=10
b=2
#print(type(a),type(b))
c=a/b
print(c)
a=10
b=2
#print(type(a),type(b))
c=a/b
print(c)
#floor division
a=11
b=2
#print(type(a),type(b))
c=a//b
print(c)
a=115465454564564545454545454545
b=2
#print(type(a),type(b))
c=a//b
print(c)
#power **
print(2**5)
print((2**5)**2)
print(10**2)
""" print "jyothi laxmi" #2.0
#integer----int
#string-----str
#float------float
#char--------xxxxxx not available

python class topic video