Monday, August 29, 2022

How to access the operating system of your device using python

import os
a=input("Enter the name of the file you wish to open")
c=os.startfile(a)
print("opening",a)
b=input("Do you wish to do it again(Y/N)-->")
if(b.lower()=="y"):
    d=input("Enter the name of the file you wish to open")
    e=os.startfile(d)
    print("opening",d)
    f=input("Do you wish to do it again(Y/N)-->")
elif(b.lower()=="n"):
    print("Operation Ended")
else:
    print("Invalid Input")

Sunday, August 28, 2022

How to make a code to insult the user using python

import random


a=input("Enter your name -->")


test_list1 = ["I never forget a face, but in your case I'll be glad to make an exception.","If you were twice as smart, you'd still b stupid.","I'm jealous of all the people who haven't met you","Somewhere out there is a tree working very hard to rplace th oxygen you consume.Now go apologize to it","It's better to let others think you are an idiot ,rather to open your mouth and prove it","They say beauty is on th inside.You better hope it's true","Don't compare yourself to others,you'd just be insulting yourself.","you're about as intresting as watching paint dry.","I wish we were better strangers.","If there is ever a price over your head take it.","you're so stupid that you can't get from A to B without going through the rest of the alphabt.","you are the kind of human that would be used as a bluprint to build an idiot","People say god cannot do a mistake but it's not true in your case.","were you born on a highway cause that's where most accidents happen","you're so dense that light bends around you"]


random_num = random.choice(test_list1)


print(a," ,",str(random_num))


b=input("Do you wish to continue (Y/N)-->")


while(b.lower()=='y'):

        

    c=input("Enter your name -->")


    test_list2=["I never forget a face, but in your case I'll be glad to make an exception.","If you were twice as smart, you'd still b stupid.","I'm jealous of all the people who haven't met you","Somewhere out there is a tree working very hard to rplace th oxygen you consume.Now go apologize to it","It's better to let others think you are an idiot ,rather to open your mouth and prove it","They say beauty is on th inside.You better hope it's true","Don't compare yourself to others,you'd just be insulting yourself.","you're about as intresting as watching paint dry.","I wish we were better strangers.","If there is ever a price over your head take it.","you're so stupid that you can't get from A to B without going through the rest of the alphabt.","you the kind of human that would be used as a bluprint to build an idiot","People say god cannot do a mistake but it's not true in your case.","were you born on a highway cause that's where most accidents happen","you're so dense that light bends around you"]


    random_num2=random.choice(test_list2)


    print(c,",",str(random_num2))


    d=input("Do you wish to continue (Y/N)-->")


    if(d.lower()=='y'):

        print("Let's continue")

    elif(d.lower()=='n'):

        print("Insulter ended")

        break

    else:

        print("Invalid Input")


Tuesday, August 23, 2022

How to make 9 green colored squares using turtle in python

from turtle import *

import turtle

bgcolor('white')

speed(5)

s=int(input("Enter the length of the rectangle"))

t=int(input("Enter the breadth of the rectangle"))

hideturtle()

fillcolor('green')

begin_fill()

forward(s)

left(90)

forward(t)

left(90)

forward(s)

left(90)

forward(t)

left(90)

forward(s)

right(90)

forward(t)

right(90)

forward(s)

right(90)

forward(t)

right(90)

back(s)

right(90)

back(t)

right(90)

back(s)

right(90)

back(t)

right(90)

back(s)

left(90)

back(t)

left(90)

back(s)

left(90)

back(t)

left(90)

forward(s+s)

left(90)

forward(t)

left(90)

forward(s)

left(90)

forward(t)

left(90)

forward(s)

right(90)


forward(t)

right(90)


forward(s)

right(90)


forward(t)

right(90)



forward(s)

right(90)


forward(t+t)

right(90)


forward(s)

right(90)


forward(t)

right(90)


back(s)

right(90)


forward(t)

right(90)


forward(s)

right(270)


back(s+s)

right(90)


back(s)

left(90)


end_fill()

Monday, August 22, 2022

Monday, August 15, 2022

(Working on a name)

 import turtle

colors=['red','purple','blue','green','orange','yellow']

t=turtle.Pen()

turtle.bgcolor('black')

for x in range(182):

    t.pencolor(colors[x%6])

    t.width(x/100+1)

    t.forward(x)

    t.left(59)


(Working on a name)

 from turtle import *


bgcolor('black')

speed(0)

hideturtle()

for i in range(118):

    color('red')

    circle(i)

    color('orange')

    circle(i*0.8)

    right(3)

    forward(3)

done()

Try it for yourself too


Wednesday, August 10, 2022

How To Make A Multiple Stream Quiz(Not yet Complete)

s=0

a=input("Enter your Stream \n A for Science \n B for Commerce \n C for Hummanities: \n")

if(a.lower()=='b'):
    print("Let's Start with Ch-1")

    print("Question 1. \n Name the input or output device used to do the following: \n")
    c=input("a) To output audio: \n")
    if(c.lower()=='speaker'):
        s=s+1
        print('Correct Answer')
        print("Your Score is -->",s)
    else:
        print("Incorrect Answer")
        print("Correct Anser is Speaker")
        print("Your Score is -->",s)
    d=input("b) To enter textual data: \n")
    if(d.lower()=='keyboard'):
        s=s+1
        print('Correct Answer')
        print("Your Score is -->",s)
    else:
        print("Incorrect Answer")
        print("Correct Anser is Keyboard")
        print("Your Score is -->",s)
    e=input("c) To make hard copy of a text file: \n")
    if(e.lower()=='printer'):
        s=s+1
        print('Correct Answer')
        print("Your Score is -->",s)
    else:
        print("Incorrect Answer")
        print("Correct Anser is Printer")
        print("Your Score is -->",s)
    f=input("d) To display the data or information:\n")
    if(f.lower()=="monitor"):
        s=s+1
        print('Correct Answer')
        print("Your Score is -->",s)
    else:
        print("Incorrect Answer")
        print("Correct Anser is Monitor")
        print("Your Score is -->",s)
    g=input("e) To enter audio-based command:\n")
    if(g.lower()=="microphone"):
        s=s+1
        print("Correct Answer")
        print("Your Score is -->",s)
    else:
        print("Incorrect Answer")
        print("Correct Anser is Microphone")
        print("Your Score is -->",s)
    h=input("f) To build 3D models:\n")
    if(h.lower()=="3d printer"):
        s=s+1
        print('Correct Answer')
        print("Your Score is -->",s)
    else:
        print("Incorrect Answer")
        print("Correct Anser is 3D Printer")
        print("Your Score is -->",s)
    i=input("Do you wish to start with Accounts Questions (Y/N):\n")
    if(i.lower()=="y"):
        print("Let's Start")
        print("Ch-1 Introduction to Accounting(MCQs)")
        j=input("Question 1. \n The art of recording all business transactions in a systematic manner in a set of books is called-\n (a) Accounting  \n (b) Book–keeping \n (c) Ledger \n (d) None of these.: \n")
        if(j.lower()=="b" or "book-keeping"):
            s=s+1
            print("Correct Answer")
            print("Your Score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is (b)Book-keeping")
            print("Your Score is -->",s)
        k=input("Question 2. \n The process of recording, classifying and summarizing all business transactions in order to know the financial result is called – \n (a) Book – keeping \n (b)Accounting \n (c) Journalizing \n (d) None of these. \n")
        if(k.lower()=="b"or"accounting"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is (b) Accounting")
            print("Your score is -->",s)
        l=input("Question 3. \n Cash, goods or assets invested by the proprietor in the business for earning profit is called- \n (a) Profit \n (b) Capital \n (c) Fixed assets \n (d) None of these.\n")
        if(l.lower()=="b" or "capital" ):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is (b) Capital")
            print("Your score is -->",s)
        m=input("Question 4. \n The person, firm or institution who does not pay the price in cash for the goods purchased or the services received is called- \n (a) Creditor \n (b) Proprietor \n (c) Debtor \n (d)None of these. \n ")
        if(m.lower()=="c" or "debtor"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is (c) Debtor")
            print("Your score is -->",s)
        n=input("Question 5. \n Book – keeping is- \n (a) An art \n (b) A science \n (c) An art and science both \n (d) None of these. \n ")
        if(n.lower()=="c" or "an art and science both"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is (c) An art and science both")
            print("Your score is -->",s)
        o=input("Do you wish to continue (Y/N)\n")
        if(o.lower()=="y"):
            print("Now we start with Fill in the Blanks")
        else:
            print("Quiz has ended")
        p=input("1. The document certifying the purchase or sale of goods or any monetary transaction is called …………… \n")
        if(p.lower()=="voucher" or "voucher"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Voucher")
            print("Your score is -->",s)
        q=input("2. The thing which is purchased and sold in the business is called ……………. \n")
        if(q.lower()=="goods" or "good"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Goods")
            print("Your score is -->",s)
        r=input("3. The things or properties which helps in smooth functioning of the business and which are owned by the business are called ……………. of the business. \n")
        if(r.lower()=="assets" or "asset"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Assets")
            print("Your score is -->",s)
        t=input("Do you wish to start with Economics Questions (Y/N):\n")
        if(t.lower()=="y"):
            print("Let's Start")
        u=input("Question 1. \n Which Economist divided Economics in two branches of micro and macro on the basis of economic activity? \n(a) Marshall \n(b) Ricardo \n(c) Ragnar Frish \n(d) None of these \n")
        if(u.lower()=="d"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is None of these")
            print("Your score is -->",s)
        v=input("Question 2. \n Which of the following is studied under Micro Economics ? \n (a) Individual unit \n (b) Economic Aggregate \n (c) National Income \n (d) None of these \n ")
        if(v.lower()=="d"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is None of these")
            print("Your score is -->",s)
        w=input("Which of the following economic activities are included in the subject-matter of Economics? \n (a) Economic Activities related to Unlimited Wants \n (b) Economic Activities related to Limited Resources \n (c) Both (a) and (b) \n (d) None of these \n ")
        if(w.lower()=="c"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Both (a) and (b)")
            print("Your score is -->",s)
        x=("Question 4. \n On which base structure of economic problems has been installed? \n (a) Unlimited Wants \n (b) Limited Resources \n (c) Both (a) and (b) \n (d) None of the above \n ")
        if(x.lower()=="c"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Both (a) and (b)")
            print("Your score is -->",s)
        y=input("Question 5. \n 'Micros' which means 'Small' belongs to: \n (a) Arabian word \n (b) Greek word \n (c) German word \n (d) English word \n")
        if(y.lower()=="b"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Greek word")
            print("Your score is -->",s)
        z=input("Question 6. \n Which of the following statement is true? \n (a) Human wants are infinite \n (b) Resources are limited \n (c) Scarcity problem gives birth to choice . \n (d) All of these \n ")
        if(z.lower()=="c"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Anser is Scarcity problem gives birth to choice")
            print("Your score is -->",s)
        aa=input("Question 7. \n Which of the following is the salient feature of factors (or resources) ? \n (a) These are limited as compared to wants \n (b) These have alternative uses \n (c) Both (a) and (b) \n (d) None of the above \n ")
        if(aa.lower()=="c"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Answer is Both (a) and (b)")
            print("Your score is -->",s)
        ab=input("Question 8. \n Which is a central problem of an economy ? \n (a) Allocation of Resources \n (b) Optimum Utilisation of Resources \n (c) Economic Development \n (d) All of these \n ")
        if(ab.lower()=="d"):
            s=s+1
            print("Correct Answer")
            print("Your score is -->",s)
        else:
            print("Incorrect Answer")
            print("Correct Answer is All of these")
            print("Your score is -->",s)
        ac=input("Do you wish to start with Business Studies Questions (Y/N):")
        if(ac.lower()=="y"):
            print("Let's Start")
        else:
            print("Quiz Ended")
            print("Your score is -->",s)    
    else:
        print("Quiz Ended")
        print("Your score is -->",s)

 for i in range (65,91):     print(chr(i))