دانلود یک کتاب آموزشی عالی برای SciPy و NumPy در پایتون
زبان : انگلیسی
جهت دانلود روی لینک زیر کلیک کنید:
دانلود یک کتاب آموزشی عالی برای SciPy و NumPy در پایتون
زبان : انگلیسی
جهت دانلود روی لینک زیر کلیک کنید:
جهت اجرای برنامه پایتون زیر می بایست با کتابخانه tkinter آشنایی داشته باشید.
#import all the required libraries first import sys from tkinter import * #import time library to obtain current time import time #create a function timing and variable current_time def timing(): #display current hour,minute,seconds current_time = time.strftime("%H : %M : %S") #configure the clock clock.config(text=current_time) #clock will change after every 200 microseconds clock.after(200,timing) #Create a variable that will store our tkinter window root=Tk() #define size of the window root.geometry("600x300") #create a variable clock and store label #First label will show time, second label will show hour:minute:second, third label will show the top digital clock clock=Label(root,font=("times",60,"bold"),bg="blue") clock.grid(row=2,column=2,pady=25,padx=100) timing() #create a variable for digital clock digital=Label(root,text="My Python's Digital Clock",font="times 24 bold") digital.grid(row=0,column=2) nota=Label(root,text="hours minutes seconds",font="times 15 bold") nota.grid(row=3,column=2) root.mainloop()
words = ("spam", "eggs", "sausages",)
شما می توانید با مقادیر خود در مقیاس به همان اندازه که با لیست ها دسترسی داشتید دسترسی پیدا کنید:
print(words[0])
تلاش برای تخصیص یک مقدار در یک Tuple، یک TypeError را ایجاد می کند.
words[1] = "cheese"
خروجی:
>>>
TypeError: 'tuple' object does not support item assignment
>>>
نکته:مانند لیست ها و dictionary ها، tuple ها را می توان در داخل یکدیگر قرار داد.
tuple ها را می توان فقط با جدا کردن مقادیر با کاما و بدون پرانتز ایجاد کرد.
مثال:
my_tuple = "one", "two", "three"
print(my_tuple[0])
خروجی:
>>>
one
>>>
یک tuple خالی با استفاده از یک جفت پرانتز خالی ایجاد می شود.
tpl = ()
نکته:tuple ها سریعتر از لیست ها هستند اما قابل تغییر نیستند.
دانلود رایگان کتاب آموزشی زبان برنامه نویسی پایتون
به زبان انگلیسی #درخواستی_شما
به درخواست شما دوستان و همراهان عزیز رادیو صدای ققنوس
کتاب آموزش زبان برنامه نویسی پایتون نسخه پنجم (جدیدترین نسخه)
از سری کتابهای برگزیده زبان پایتون را در اینجا آپلود میکنم.
همیشه در حال یادگیری و پیروز باشید. #سعید_دامغانیان
مثال هایی از SORT (مرتب سازی ) در پایتون. تحلیل و تفسیر با شما...
موفق و پیروز باشید #سعیددامغانیان