Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

Notes On Python Programming

Loading...

Published in: Python Programming
920 Views

Learn to code with Python

Ganesh K / Pune

1 year of teaching experience

Qualification: MCA (SPPU - 2020)

Teaches: Content Writing, Leadership Skills, Personality Development, Big Data & Hadoop, Business Analytics, Cloud Computing, Data Structures, DBMS & RDBMS, MongoDB, IT, English, .Net, C / C++, Java And J2EE, Python Programming, Visual Basic, Bootstrap, Java Script, PHP And MySQL

Contact this Tutor
  1. 6/30/2020 print( 'Hello World') Hello World In input("Enter any string str print(str) Enter any string: ganesh ganesh # User enters the year - int(input("Enter Year • year # Leap Year Check if year % 4 e and year % lee ! = e: 'is a Leap Year") print(year, elif year % 100 = print(year, 'is not a Leap Year") elif year % 400 print(year, 'is a Leap Year") else: print(year, 'is not a Leap Year") Enter Year: 2020 2020 is a Leap Year In # taking user input input("Enter a character: ch if((ch>='a' and ch
  2. 6/30/2020 In [10]: # two float values vall - 100.99 va12 = 76.15 # Adding the two given numbers sum = float(vall) + float(va12) # Displaying the addition result print("The sum of given numbers is: The sum of given numbers is: 177.14 # taking input from user - int(input("Enter any number number Untitled 1 sum) # prime number is always greater than 1 if number for i in range(2, number): if (number % i) print (number, 'is not a prime number") break else: lis a prime number") print (number, # if the entered number is Less than or equal to 1 # then it is not prime number else: 'is not a prime number") print (number, Enter any number: 2 2 is a prime number In [12]: - int(input("Enter any number: num flag num%2 if flag print(num, 'is an even number") elif flag -1: print(num, 'is an odd number") else: print("Error, Invalid input") Enter any number: 2 2 is an even number local host: 8888/nbconvert/htm I/U ntitled 1 .ipynb?download =false 2/4
  3. 6/30/2020 In [13]: Untitled 1 # User inputs the string and it gets stored in variable str input("Enter a strxng• str # counter variable to count the character in a string counter for s in str: counter counter+l print("Length of the input string is: Enter a string: hello Length of the input string is: 5 In [14]: counter) # User inputs the string and it gets stored in variable str input("Enter a string str # using Len() function to find Length of str print("Length of the input string is: len(str)) Enter a string: shyam Length of the input string is: 5 In [15]: # Python 3 program to find # factorial of given number def factorial (n): # single Line to find factorial return 1 if (n==l or else n factorial (n # Driver Code num print("Factoria1 of" , num, "is", factorial (num)) # This code is contributed by Smitha Dinesh Semwal Factorial of 5 is 120 In [16]: # Python program to find Area of a circle def findArea(r): - 3.142 return PI * # Driver method print("Area is %.6f" % findArea(5)); # This code is contributed by Chinmoy Lenka Area is 78.550000 local host: 8888/nbconvert/htm I/U ntitled 1 .ipynb?download =false 1); 3/4
  4. 6/30/2020 In [ local host: 8888/nbconvert/htm I/U ntitled 1 .ipynb?download =false Untitled 1 4/4