Skip to content

Instantly share code, notes, and snippets.

@theDreamer911
Created February 12, 2022 16:00
Show Gist options
  • Save theDreamer911/a78ec2e6f3613d0b715e908295192526 to your computer and use it in GitHub Desktop.
Save theDreamer911/a78ec2e6f3613d0b715e908295192526 to your computer and use it in GitHub Desktop.
This code is for built CSV with Python
name = input("Filename: ")
n = int(input("How many data: "))
print("\a")
for i in range(n):
print("Data Number-" + str(i+1))
first = str(input("First name: "))
last = str(input("Last name: "))
print("\a")
with open(f"{name}", "a") as f:
f.write(f'"{str(i+1)}","{first}","{last}"')
f.writelines('\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment