Summary of the text
Write a function that receives a text and returns the first 100 characters with "..." if the text is longer than 100 characters. Otherwise it will restore the whole text unchanged.
Write a function that receives a text and returns the first 100 characters with "..." if the text is longer than 100 characters. Otherwise it will restore the whole text unchanged.
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
import math as m def matn(m): # Check whether the text is 100 characters if len(m) >= 100 : return m[:100] + "..." else : return m matnvorodi=input('matn morede nazar ra vared konid:') print(matn(matnvorodi))
def short(x): if len(x) > 100: b = x[:100+1] + '...' return b else: return x txt = input('text: ') print(short(txt))
def short_passage(passage): if len(passage) > 100: shorted_passage = passage[0:100] return shorted_passage else: return passage def main(): passage = input("please Enter your passage: ") editted_passage = short_passage(passage) #print("«" + editted_passage + "»" ) print(f"«{editted_passage}»") if __name__ == "__main__": main()
def short_String(string): if len(string) > 100: return string[0:100] + "..." else: return string num = input('string: ') print(short_String(num))
def matn(): str = input("please enter a string: ") if len(str) > 100: print (str[0: 100], "...") else: print(str) print(len(str)) matn()
def text(t): if len(t) > 100: return t[:100] + "..." else: return t text(input("Enter :")) print(text)
text = input('Enter your text : ')
def text_spilt(text):
if len(text) <= 100 :
return text
else:
return f'"{text[0:101]}"'
print(text_spilt(text))
Submitting answers is currently unavailable.
Write a class that receives two numbers and the methods of subtraction, multiplication and division can be called. By calling each method, the necessary calculations are required and the result is returned in
Write a function that receives a string and returns the number of letters: To solve this question, you should not use ready-made functions for example: get_len ('code-bezan.ir') # 13
Write a program that receives 2 users and calculates the Fibonacci series (between those two) and prints in the output
برای استفاده از این بخش باید وارد حساب کاربریت بشی
ورود/ثبت نام If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.