Open philusnarh opened 6 years ago
Try the following Python Basic exercises::
Sample String : "Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are" Output :
Twinkle, twinkle, little star,
How I wonder what you are!
Up above the world so high,
Like a diamond in the sky.
Twinkle, twinkle, little star,
How I wonder what you are
Write a Python program which accepts the user's first and last name and print them in reverse order with a space between them.
Write a Python program to get the volume of a sphere with radius 6.
Write a Python program to test whether a number is within 100 of 1000 or 2000.
Write a Python program to find whether a given number (accept from the user) is even or odd, print out an appropriate message to the user.
Write a Python program to test whether a passed letter is a vowel or not.
How to handle Arrays and make plots
import numpy as np check = np.zeros((9, 9)) check[::2, 1::2] = 1 check[1::2, ::2] = 1 import matplotlib.pyplot as plt plt.imshow(check, cmap='gray', interpolation='nearest')
%load_ext autoreload %autoreload 2 import matplotlib.pyplot as plt %matplotlib inline
Lexical Conventions and Syntax Basic syntax Variables Operators Division and Type Conversion Augmented Assignment Namespaces
Data types Numbers Strings String manipulation String operations String methods
Lists List notation List creation shortcuts Operations on lists List Attributes Combining lists list slices Comparing lists Sorting lists List methods
Dictionaries Dictionary notation Operations on Dictionaries Combining two Dictionaries Deleting from dictionary
Sets Constructing Sets Membership Testing Removing Items Iteration Over Sets Set Operations
Flow control Loops ( For, While, Breaking, continue, else) Branches
Functions Function calls Defining functions Declaring Arguments Default Argument Values Variable-Length Argument Lists Closure lambda Scoping