Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 7
How to write a program that calculates this? (1-0.5+0.33-0.25.....)
19 Respostas
+ 8
Your attempt ??
Just try yourself first.
If you fail, then just share your code with us(sololearn community) and we will tell where is the problem and how to overcome it so that you become better at itš
+ 4
Arsenic i added nowš¶
+ 4
Kit D. Cat i got it..thank youš
+ 4
Sunny your question seems separate from this thread.
+ 3
print(eval("1-0.5+0.33-0.25"))
+ 3
You could need % operator.
+ 1
To answer Sunny even if it is another thread : maybe make the print as a string like this : ("I am in", love) ? as well as "happiness".
But I'm new to coding, so I might be wrong. And sorry for my bad English.
+ 1
recursive function:
def addition(n,x=1,y=0.5):
return x-y if n==0 else x-y+addition(n-1,x*0.33,y/2)
+ 1
Mohammad Gk ŲØŲ§Ų“Ł ŁŁŁ
ŪŲÆŁ
..
Ł
ŪŲ“Ł Ų³ŁŲ§Ł Ų¬ŲÆŪŲÆŁ
Ł ŁŚÆŲ§Ł Ś©ŁŪŲÆā¹Ų
0
so why does love=happiness
print( I am in love )
gives me error?
0
Hi
0
Ų±Ų§Ų³ŲŖŪ ŁŁŲŖŪ Ł
ŪŲ®ŁŲ§Ū Ų§Ų² ŲŖŲ§ŲØŲ¹ Ų§Ų³ŲŖŁŲ§ŲÆŁ Ś©ŁŪ ŁŁŲ· ŪŚ© Ł
ŁŲÆŲ§Ų± ŲØŁŲ“ ŲØŲÆŁ ŪŁŪ Ł
ŁŲÆŲ§Ų± n. Ł
Ų«Ł addition(1). Ų§ŁŲØŲŖŁ Ł
ŪŲŖŁŁŪ Ł
ŁŲÆŲ§Ų± ŁŲ§Ū ŲÆŁŲ®ŁŲ§Ł ŁŁ
ŲØŲ±Ų§Ū x ŪŲ§ y ŁŁ
ŲØŁ Ų¹ŁŁŲ§Ł Ų¢Ų±ŚÆŁŁ
Ų§Ł ŲØŁŲ“ ŲØŲÆŁ.
0
Sunny i think the right away should be-
love = āHappinessā
print(āI am inā+ ā ā + love)
new to coding: might be wrong
open to correction
0
Write the output of the following program on execution of x=50
0
nc pubg host
0
Ckgk
0
Hi
- 1
What sunny says is right
- 1
Write a C program to input any character and check whether it is alphabet, digit or special character