Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

PyGame Guide/Python Crash Course

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

A basic program A simple Hello World program: print("Hello World") Variables Variables in Python are dynamically typed. This means that a variable may hold either a number, string, or any object. variably = 40 variably = 40.9 variably = "forty point nine" print(variably) # Based on the assignment above, this will print "forty point nine" Input and output If statements if True: print("This will always execute") if 6 > 5: print("6 is, in fact, greater than 5") variably = False if variably: print("variably is True") else: print("variably is False") letter = "a" if letter == "a": print("got option A") elif letter == "b": print("got option B") elif letter == "c": print("got option C") else: print("got unknown option") While loops For loops Functions Classes Inheritance