Thursday, November 3, 2016

Random Python Programs: November 2 2016

Flashcard Prototype 1

counter = 0
while counter>=0:
print("----------------------------")
title = input("What is the Title of This flashcard?:")
contents = input("What are the Contents of this flashcard?:")
counter += 1
print("----------------------------")
print("Flashcard",counter)
print("Title:",title)
print("Contents:",contents)

Flashcard Prototype 2

title = input("What would you like to name these notes?:")
title = title +".txt"
file = open(title, "w")
counter = 0
while counter>=0:
title = input("What is the Title of This flashcard?:")
contents = input("What are the Contents of this flashcard?:")
counter += 1
print("----------------------------")
print("Flashcard",counter)
print("Title:",title)
print("Contents:",contents)
print("----------------------------")
a = "Flashcard" + " "+str(counter)
b = "Title:"+" "+title
c ="Contents:"+" "+contents
file.write("----------------------------")
file.write(a)
file.write(b)
file.write(c)
file.write("----------------------------")

No comments:

Post a Comment