xxxxxxxxxx
#!/usr/bin/python
str = "THIS IS STRING EXAMPLE....WOW!!!";
print str.isupper()
#Prints True
str = "THIS is string example....wow!!!";
print str.isupper()
#prints False
xxxxxxxxxx
# string арга .upper() нь бүх жижиг үсгүүдийг том үсгээр хөрвүүлсэн мөрийг буцаана.
dinosaur = "T-Rex"
print(dinosaur.upper())
# Prints: T-REX
xxxxxxxxxx
greet = 'Hello Bob'
up1 = greet.upper()
# up2 = upper(greet) - This doesn't work
# print(up2) - Remember this will give you a Syntax Error
print(up1) # Output: HELLO BOB
# Another thing, this will give us only a copy,
# Original string remains the same
print(greet) # Hello Bob
xxxxxxxxxx
def my_function(a, b, *rest):
print("a:", a)
print("b:", b)
print("rest:", rest)
my_function(1, 2, 3, 4, 5)