😷Let's Program😷
Posting anything bout coding that helps us go forward into our near future And we will do from the beginning to the end -- make a website -- make a bot by coding -- make an AI like siri and more
Ko'proq ko'rsatishMamlakat belgilanmaganTil belgilanmaganToif belgilanmagan
144
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kunlar
Ma'lumot yo'q30 kunlar
- Kanalning o'sishi
- Post qamrovi
- ER - jalb qilish nisbati
Ma'lumot yuklanmoqda...
Obunachilar o'sish tezligi
Ma'lumot yuklanmoqda...
By the way, if you find other ways...I would love to see them in the comments.
🟢Answer🟢
word = input("Word: ")
for x in range(1,len(word)+1):
reverse = word[-x]
print(reverse, end="")
These is not the simplest way of doing it...obviously but its how you do it from what you have learnt so far.
@StillCoding2)
sep=""
It is used to separate to different strings in one print function.It is used to enter a separator between the two strings.
Like...
print("hello!", "how are you", sep="&&")
print("Elon", "Musk", "Tesla", sep="--")
Results are:
hello!&&how are you
Elon--Musk--Tesla
🟢#025
end
and sep
arguments
1) end=""
It is used to determine how the print function should end.The default setup is for it to go to the next line.
print("hello!")
print("how are you?")
Result is:
hello!
how are you?
But with end
=""
...
print("hello!", end=" ")
print("how are you?")
Result is:
hello! how are you?
@StillCoding🟢Assignment time🟢
Make a Python program that can output the reverse of a word.
Answer after 2 days!!!
@StillCoding
By the way, if you want to visit my personal twitter account
Its https://mobile.twitter.com/DagmNiko
Just opened it so please follow!
🟢#024
min
,max
,abs
and pow
min()
is used to get the minimum value of the given arguments(integers)
max()
is used to get the maximum value of the given arguments(integers)
The abs()
function returns the absolute (positive) value of the specified number.
The pow(x, y)
function returns the value of x
to the power of y
(xy
).
Example:
minimum = min(5,10,15)
maximum = max(5,10,15)
absolute = abs(-3)
power = pow(5,2)
print(minimum)
print(maximum)
print(absolute)
print(power)
Results:
5
15
3
25
@StillCoding🟢#023
lambda function
lambda
function is a shorter way of writing a function.
Example 1:
name = lambda f_name, l_name : f"hi {f_name} {l_name}!"
print(name("dagm", "niko"))
Result:
hi dagm niko!
Example 2:
add = lambda a, b : a + b
print(add(5,5))
Result:
10
@StillCodingለመላው እስልምና እምነት ተከታይ በሙሉ እንኳን ለ1442ኛው ለኢደ አልፈጥር በሰላም አደረሳችሁ!!
ኢድ ሙባረክ 🌙🕋
🕌@StillCoding🕌
Boshqa reja tanlang
Joriy rejangiz faqat 5 ta kanal uchun analitika imkoniyatini beradi. Ko'proq olish uchun, iltimos, boshqa reja tanlang.