## Wednesday, September 16, 2020

Solution Exercises 66: algorithm python that ask user to type his personnal informations and save it in a txt file

#### Exercise 66

Write an algorithm in python which asks the user to type his name, his age, his email and creates a file named personal_informations.txt containing all the information entered. Example if the information entered is: David, 37 years old, david37@gmail.com, the personal_information.txt file must contain the following information: Name: David. Age: 37 years old. Email: david37@gmail.com

#### Solution

import os
# let's create the file that will contain the personal informations in writ mod
fileInfo = open("personal_information.txt" , "w")
# Asking user to enter his informations
Name = input("Enter your name : ")
fileInfo.write("Name : " + Name + '\n')
Age = input("Enter your age : ")
fileInfo.write("Age : " + Age + '\n')
Email = input("Enter your email : ")
fileInfo.write("Email : " + Email + '\n')
fileInfo.close()
os.startfile("personal_information.txt")

Younes Derfoufi
my-courses.net

## Python Exercises With Solutions

1. Python Arithmetic Exercises
2. Equations & System Of Equations
3. Polynomials and Functions
4. Python Arithmetic Exercises
5. Numpy, Matplolib, Sympy , Scipy - Exercises
6. Python Arithmetic Exercises

Younes Derfoufi