Skip to main content

User account menu

Show — User account menu Hide — User account menu
  • Log in
Scalingbits
Make the Internet scale

Primary links

Show — Primary links Hide — Primary links
  • Impressum (Imprint)
  • Privacy Policy
  • about

Breadcrumb

  1. Home
  2. Python

Function and Modules (Cheat Sheet)

Example

Functions need to be declared in the file before they can be used

def my_function():
   print("I")
   print("am")
   print("a")
  print("function")

my_function()

Parameter and variables declared in a function are local to the function

Returning values

def min(alb):
   if a < b :
      return a
   else:
      return b

print min(5,8)

 

  • Printer-friendly version
  • Log in to post comments
  • 52 views

Book traversal links for Function and Modules (Cheat Sheet)

  • ‹ Exceptions and their handling (Cheat Sheet)
  • Up
  • Functional Programming ›

Search

LocalNavigation

Show — LocalNavigation Hide — LocalNavigation
  • Blogs
  • Drupal
  • MySQL
  • Internetauftritte in Deutschland
  • tracking (SEO)
  • AWS
  • Java
  • Solaris
  • Dictionaries (Cheat Sheet)
  • Exceptions and their handling (Cheat Sheet)
  • Function and Modules (Cheat Sheet)
  • Functional Programming
  • Lists and Ranges (Cheat Sheet)
  • Loops and Branches (Cheat Sheet)
  • Numeric Functions
  • Strings (Cheat Sheet)
  • Tuples (Cheat Sheet)
  • Working with Files (Cheat Sheet)

Main navigation

Show — Main navigation Hide — Main navigation
  • Home

Today's:

  • 8.2 Vererbung in Java
  • Überblick Java Collections
  • JFrame
  • JMenuBar, JMenu, JMenuItem
  • 6.2 Heap-Größe und Freigabe von Speicher (Garbage Collection)

Last viewed:

  • Installation of a Graphical Desktop with RDP Access for SUSE SLES 11, 12, 15 or Ubuntu
  • Sortieralgorithmen
  • Bad Hair Days (with SLES for SAP)
  • Überblick Java Collections
  • 8.2 Vererbung in Java