“python simpan input ke file teks” Kode Jawaban

python simpan input ke file teks

#Simple Mood Diary Script As An Example#

print('My Mood Diary')
mood = input('How are you feeling today? ')
#Saves the input as the variable 'mood'#
text_file = open("MoodDiary.txt", "w")
#Opens or creates the .txt file, sharing the directory of the script#
text_file.write(mood)
#Writes the variable into the .txt file#
text_file.close()
#Closes the .txt file#
Ruukasu

python simpan input ke file teks

Simple Mood Diary Script As An Example#

print('My Mood Diary')
mood = input('How are you feeling today? ')
#Saves the input as the variable 'mood'#
text_file = open("MoodDiary.txt", "w")
#Opens or creates the .txt file, sharing the directory of the script#
text_file.write(mood)
#Writes the variable into the .txt file#
text_file.close()
#Closes the .txt file#
Combative Caribou

Jawaban yang mirip dengan “python simpan input ke file teks”

Pertanyaan yang mirip dengan “python simpan input ke file teks”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya