عملت أول برنامج بلغة بايثون بحمد الله .. برنامج حاسبة بسيطة وهو دا الكود الخاص بيه
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Filename: calculator.py | |
# -*- coding: utf-8 -*- | |
# | |
# PyCalc, simply python calculator. | |
# | |
# Copyright (C) 2010 Muhammad Afifi (m.afifi.cs@gmail.com) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
# GNU General Public License for more details. | |
# | |
# You should have received a copy of the GNU General Public License | |
# along with this program. If not, see <http://www.gnu.org/licenses/>. | |
running = True | |
while running: | |
no1 = int(raw_input('\nNo1:')) | |
op = raw_input('OP :') | |
no2 = int(raw_input('No2:') ) | |
if(op=='+'): | |
eq=no1+no2 | |
elif(op=='-'): | |
eq=no1+no2 | |
elif(op=='*'): | |
eq=no1*no2 | |
elif(op=='/'): | |
eq=no1/no2 | |
else : | |
eq='Error in Operator!' | |
print 'Result of ',no1,op,no2,'=',eq | |
ans = raw_input("\nDo u want to do another calculation (y|n)? :") | |
if(ans=='n' or ans=='N'): | |
running = False | |
else: | |
print 'You say no , Good by |
ودى صورة لتجربة البرنامج تجربة عملية 
هناك ٣ تعليقات:
مبروووك
عقبال برنامج السعودية ونكيد الأعادي!
الاول الف شكر وبارك الله فيك اخي محمد اتمنى منك النضمام لي مدونة اوبنتو سنتر فهي تحتاج لي خبارتك وهي مدونة واعده وتحمل مجموعه من شباب المميز
اتمنى نظمامك لهم او دمج مدونتك معهم
اخى الكريم عبدالله الخريصى
أنا منشغل معظم الوقت فى عملى .. وأضع جزء يسير منه للمطالعة على الإنترنت وقليلا ما أرد ..
أنا متابع مثلا مدونة تيدوز منذ فترة ولن تجد لى ردًا هناك بخلاف موضعين فقط ..
وموضوع لينكس واحد منهم ..
أتشرف بالانضمام لكم طبعًا .. ولكن إذا سمح لى الوقت فى المستقبل إن شاء الله
أخوك محمد عفيفى
إرسال تعليق