-3
file_1 = File.open('Data_family.txt', 'r')
user1 = go
while user1 != "stop"
print "whould you like to create: "
user1 = gets.chomp
print "what is your relation: "
relation = gets.chomp
file_1.syswrite "this is your " + relation
file_1.syswrite "\n"
end
file_1.close
我很困惑,爲什麼塊沒有運行。我喜歡對子級創建家譜數據庫但它不會讓我將數據添加到我打開不能添加數據到文件
什麼是你的問題? – sawa 2014-10-03 17:14:04
如果您還將錯誤信息提供給您,它將有所幫助。我的猜測是,在第二行,'user1 = go'應該在引號內:'user1 =「go」'。 – htanata 2014-10-03 17:17:43
爲什麼它不允許我進入循環 – 2014-10-03 17:22:30