Thursday, June 27, 2019

if else and elif loops in python

# Import the modules
import sys
import random

ans = True

while ans:
    question = raw_input("Ask the magic 8 ball a question: (press enter to quit) ")
   
    answers = random.randint(1,8)
   
    if question == "":
        sys.exit()
   
    elif answers == 1:
        print("It is certain")
   
    elif answers == 2:
        print ("Outlook good")
   
    elif answers == 3:
        print ("You may rely on it")
   
    elif answers == 4:
        print ("Ask again later")
   
    elif answers == 5:
        print ("Concentrate and ask again")
   
    elif answers == 6:
        print( "Reply hazy, try again")
   
    elif answers == 7:
        print("My reply is no")
   
    elif answers == 8:
        print( "My sources say no")

keil software ..how to start coding using keil software and stm32f103C8T6

1.install the  keil software first and run the program.
2.in projects tab select the new keil project
refer below images








write your code in text editor then click on build and compiler after compltion then click 
on the load ..
after clicking on the load code will automatically uploads.

python class topic video