Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added plugin infob17035 #44

Open
wants to merge 1 commit into
base: cs308
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions custom/infob17035.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
from plugin import plugin

@plugin("infob17035")
def infob17035(jarvis, s):
''' Give info about B17035'''
get_student_info(jarvis, s.upper())

def get_student_info(jarvis, argument):

helptext = "Welcome to the info plugin of Ankit Jiganwal roll num B17035.\n\
Please select one of the options below: \n \
[F]ull name\n \
[H]ometown\n \
Favourite [M]ovie\n \
Favourite [S]portsperson\n \
Launch [P]ython program written by me\n"

option = { "F" : "Ankit Jiganwal",
"H" : "Gwalior, India",
"M" : "Your Name",
"S" : "Messi"
}.get(argument, "default")
if argument == 'P':
small_python_program(jarvis)
elif option != "default":
jarvis.say(option);
else:
jarvis.say(helptext)

def small_python_program(jarvis):
# jarvis.say("Let me show you a magic trick.\n Enter a number between 1 and 9 : ")
num = input("Let me show you a magic trick.\n Enter a number between 1 and 9 : ")
jarvis.say("Now add 9 to the number and press enter")
input()
jarvis.say("Multiply 5 to the result and press enter")
input()
jarvis.say("Subtract 10 from the reult and press enter")
input()
# jarvis.say("Now tell me the result : ")
input("Now tell me the result : ")
jarvis.say("I'll tell you the number you picked at the start\nThe number was : " + num)