Python Code.docx

  • Uploaded by: Amirul Hakim
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Python Code.docx as PDF for free.

More details

  • Words: 158
  • Pages: 2
Mathematic functions Pow(2,3) Abs(no) -5  5 Max( 4, 6) which number is higher Min (4,3 ) Round (3.7) ==4 From math import* Floor(3.7) ==3 Ceeling (3.1) ==4 Sqrt(36)=6

Get input from user Name = Input (“enter your name”)

List Friends = [“yol”, “sdada”, “dsadsa”, 2, false] Print (friends[0] )==yol Print(friends[-1]== false (start dari belakang) Print(friends[1:3]) == index 1 till 3 Modified Friends.extend(can be variable ) Friends.append(“yol”) =always add item at the end of the list Friends.insert (1,”yol”)== add in the middle Friends.remove(“yol”)=- yol out of the list Friends.clear()== remove all from the list Friends.pop() == last element out kanan sekali Friends.index(“yol”)= yolk at index 1. But print out keluar nombor Friends.count(“yol”)= kira berapa ada but print out number Friends.sort()==alphabetical order/ascending order Luckynumbers.reverse()=reverse order Friends2=friends.copy()=literally copy

Tupples Coordinates = (2,3) cannot be modified List Coordinates = [2,3] can be modified

Functions Def sayhi () Print (“hi”) Sayhi()

What to Do When You Miss a Call From a Recruiter

Related Documents

Python
November 2019 59
Python
June 2020 31
Python
June 2020 30
Python
November 2019 31
Python
May 2020 20
Python
April 2020 23

More Documents from ""