def findSLTP():
c = int(input("Enter current market price : "))
print("SLTP for " + str(c) + " at 6% loss should be : " + str(int(c - 0.06*c)))
x = input("Press Enter to exit application ")
findSLTP()
def findSLTP():
c = int(input("Enter current market price : "))
print("SLTP for " + str(c) + " at 6% loss should be : " + str(int(c - 0.06*c)))
x = input("Press Enter to exit application ")
findSLTP()
def findProfit():
x = 'a'
while x != 'n' or x != 'N':
c = float(input("Enter current market price : "))
s = float(input("Enter expected sell price : "))
a = float((s - c)/c)*100
formatted_a = "{:.2f}".format(a)
print("% Profit for buy at " + str(c) + " and expected sell at " + str(s) + " would be : " + str(formatted_a) +"%")
print()
#x= input("Want to continue (y/n) :")
#if x == 'n':
#exit()
findProfit()
Up trending stocks are best for trading, followed by sideways consolidating stocks.
Trading in long-term downtrending stocks should be avoided.
n deterministic algorithm, for a given particular input, the computer will always produce the same output going through the same states but in case of non-deterministic algorithm, for the same input, the compiler may produce different output in different runs. In fact non-deterministic algorithms can’t solve the problem in polynomial time and can’t determine what is the next step. The non-deterministic algorithms can show different behaviors for the same input on different execution and there is a degree of randomness to it.
Source: https://www.geeksforgeeks.org/difference-between-deterministic-and-non-deterministic-algorithms/.
Define a Regular Expression for given DFA.
Define a DFA for the given Regular Expression.
Give the language for the given Regular Expression.
Give the Regular Expression for the given Language.
Construct a DFA for given language.
Construct a PDA for given language.
Construct a TM for given language.
Give a CFG for the given language.
Give the language generated by the given CFG.
Show that given CFG is ambiguous.
from flask import Flask app = Flask(__name__) #In Flask, URL rules can be added using either the @app.route() decorator or the app.add_url_...