Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from math import *
- number = 38;
- print(str(number) + " is my favourite number"); # Μετατρέπω integer σε string μέσω της συνάρτησης str()
- number = -number;
- print(abs(number)); # Απόλυτη τιμή
- print(pow(4, 6));
- print("Max of " + str(number) + " and 50 is: " + str( (max(number, 50)) ));
- newNumber = min(number, -40);
- print(abs(newNumber));
- num = round(3.8);
- num2 = round(3.2);
- print(num); # Στρογγυλοποίηση
- print(num2); # Στρογγυλοποίηση
- print(round(-4.1)) # Στρογγυλοποίηση
- print("\n")
- # Math Functions from import
- print("Other math functions");
- print(floor(8.8));
- print(ceil(8.8));
- print(sqrt(36));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement