My Python Notes
Oct 03 2017- POSTED BY projecth
A list must be homogeneous, its elements all should be from the same type. If an element in a […]
Read MoreA list must be homogeneous, its elements all should be from the same type. If an element in a […]
Read More##################################################### ###################### General ###################### ##################################################### print(“Bashar”) help(print) # Helps you understand what the function print() does help(str.rjust) # Helps you […]
Read MoreMy Solution Guess a number from 1 to 10 game. import random def init_game(): print(“Guess a number between 1 and 10. […]
Read MoreIntroduction To Functions Definition def say_hello( ): print(“Hello!”) Arguments def add_to_two(num): print(num+2) >>> add_to_two(2) 4 Return def square(num): return num*num […]
Read MoreLists Lists my_list = [ 1, 2.5, ‘a’ ] >>> list(‘a’) # Function creates a list of characters from the […]
Read MoreNumeric Variables a = 1, b = 2 c = a + b >>> print(c) 3 int( variable ) [string_multiply]: input_string […]
Read MoreInput/Output Output: print(“Bashar”) Input: input(“What is your name?”) >>> name = input(“What is your name? “) What is your name? Bashar >>> print(name) Bashar String Concatination [lumberjack.py]: name = input(“What’s your name? “) […]
Read MoreAt the end of this course, we’re going to build a Guess the Number game. There are two ways to […]
Read More